Javascript google map in site
-
Hi evryone, it’s my first post here.
I’ve tried to put some JavaScripts into new post or pages, the code is working properly on other sites but dont in wordpress, I’ve changed writing mode from Visual to text and paste my code, try to install some plugins, insert code in iframe, and anyone can’t works
my code: “
<div id=”map” style=”width: 650px; height: 500px;”></div><script type=”text/javascript”>
var locations = [
[‘ Cz?stochowa ‘, 50.797301 , 19.0562043 , 49 ],
[‘ Gdańsk ‘, 54.3349184 , 18.6520926 , 50 ],
[‘ Warszawa ‘, 52.2247434 , 20.9905342 , 51 ],
[‘ Poznań ‘, 52.377827 , 16.8831355 , 52 ],
[‘ Jas?o ‘, 49.7266513 , 21.4516216 , 53 ],
[‘ Rzeszów ‘, 50.0166035 , 22.006821 , 54 ],];
var map = new google.maps.Map(document.getElementById(‘map’), {
zoom: 6,
center: new google.maps.LatLng(52.07, 19.48),
mapTypeId: google.maps.MapTypeId.ROADMAP
});var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});google.maps.event.addListener(marker, ‘click’, (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>
“
can you give me some advice?
- The topic ‘Javascript google map in site’ is closed to new replies.