Created
January 19, 2015 18:54
-
-
Save jonaslsl/173bdc33bbf1dd6b700c to your computer and use it in GitHub Desktop.
google maps customized
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function initialize() { | |
var mapCanvas = document.getElementById('mapsp'); | |
var myLatlng = new google.maps.LatLng(-92.22222, -78.11122); | |
var iconBase = '<?php bloginfo('template_url'); ?>/img/'; | |
var mapOptions = { | |
center: myLatlng, | |
zoom: 16 | |
} | |
var map = new google.maps.Map(mapCanvas, mapOptions); | |
var marker = new google.maps.Marker({ | |
position: myLatlng, | |
map: map, | |
icon: iconBase + 'mapicon.png' | |
}); | |
var contentString = ''; | |
var infowindow = new google.maps.InfoWindow({ | |
content: contentString | |
}); | |
google.maps.event.addListener(marker, 'click', function() { | |
infowindow.open(map,marker); | |
}); | |
} | |
google.maps.event.addDomListener(window, 'load', initialize); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment