Created
January 21, 2013 07:15
-
-
Save mazharul/4584170 to your computer and use it in GitHub Desktop.
Sample map code for farhan
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB8W_JvhLDsIX_dSiWo91mhGG5jVYA1IIY&sensor=true"></script> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
| <style type="text/css"> | |
| html { height: 100% } | |
| body { height: 100%; margin: 0; padding: 0 } | |
| #map_canvas { height: 100% } | |
| </style> | |
| <script type="text/javascript"> | |
| function initialize() { | |
| var myLatlng = new google.maps.LatLng(3.232214,101.380968); | |
| var mapOptions = { | |
| zoom: 4, | |
| center: myLatlng, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP | |
| } | |
| var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); | |
| var image = 'image.png'; | |
| var myLatLng = new google.maps.LatLng(3.232214,101.380968); | |
| var contentString = '<div>'+ | |
| "<img src='icon.jpg' />"+ | |
| 'content might go here'+ | |
| "Pretty much thats it, ohh wait links: <a href='http://google.com.my'>google</a>" | |
| '</div>'; | |
| var infowindow = new google.maps.InfoWindow({ | |
| content: contentString | |
| }); | |
| var beachMarker = new google.maps.Marker({ | |
| position: myLatLng, | |
| map: map, | |
| icon: image | |
| }); | |
| google.maps.event.addListener(beachMarker, 'click', function() { | |
| infowindow.open(map,beachMarker); | |
| }); | |
| } | |
| </script> | |
| </head> | |
| <body onload="initialize()" style="width:100%; height:100%"> | |
| <div id="map_canvas"> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment