Created
August 9, 2011 12:36
-
-
Save rpepato/1133925 to your computer and use it in GitHub Desktop.
Add a simple map from Google Maps to a web application
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<script src="http://maps.google.com/maps?file=api&v=28&key=xyz" type="text/javascript"> <!-- the required library for google maps usage --> | |
</script> | |
</head> | |
<body> | |
<div id="map" style="width: 500px; height:400px"></div> | |
<script type="text/javascript"> | |
var map = new GMap2(document.getElementById("map")); <!-- must set the div where the map will render --> | |
map.setCenter(new GLatLng(39.754286, -104.994637), 16); <!-- Google uses 17 point scale. Level 0 is entire world - Level 17 is zoomed into the street level --> | |
map.addControl(new GLargeMapControl()); <!-- Add control to control zoom and pan --> | |
map.addControl(new GMapTypeControl()); <!-- Add control to change map view --> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment