Created
September 18, 2014 15:10
-
-
Save garmjs/dd216b6d655e98f312f4 to your computer and use it in GitHub Desktop.
Custom Google MAP
This file contains hidden or 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
| 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