Skip to content

Instantly share code, notes, and snippets.

@garmjs
Created September 18, 2014 15:10
Show Gist options
  • Select an option

  • Save garmjs/dd216b6d655e98f312f4 to your computer and use it in GitHub Desktop.

Select an option

Save garmjs/dd216b6d655e98f312f4 to your computer and use it in GitHub Desktop.
Custom Google MAP
function init() {
var mapCanvas = document.getElementById('map_canvas');
var mapOptions = {
center: new google.maps.LatLng(find.latitude, find.longitude),
zoom: 17,
scrollwheel: false,
styles:
[
{
"stylers": [
{ "hue": "#ff001a" },
{ "weight": 0.1 },
{ "lightness": -57 }
]
}
],
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(mapCanvas, mapOptions);
var marker = new google.maps.Marker({
position: {
lat: find.latitude,
lng: find.longitude
},
map: map,
animation: google.maps.Animation.DROP,
});
google.maps.event.addListener(marker, 'click', anmMarker);
function anmMarker() {
if (marker.getAnimation() != null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}
var infoWindow = new google.maps.InfoWindow({
content: "Rr. Isa Boletini, Ulpianë 10000, Prishtine."
});
infoWindow.open(map, marker);
}
google.maps.event.addDomListener(window, 'load', init);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment