Created
September 1, 2009 19:48
-
-
Save ccarpenterg/179329 to your computer and use it in GitHub Desktop.
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
var latitude = -33.704959; | |
var longitude = -70.879347; | |
var description = "Santiago, Chile"; | |
var startZoom = 15; | |
var map; | |
function addMarker(latitude, longitude, description) { | |
var marker = new GMarker(new GLatLng(latitude, longitude)); | |
GEvent.addListener(marker, 'click', | |
function() { | |
marker.openInfoWindowHtml(description); | |
} | |
); | |
map.addOverlay(marker); | |
} | |
function init() { | |
if (GBrowserIsCompatible()) { | |
map = new GMap2(document.getElementById("map")); | |
map.addControl(new GLargeMapControl()); | |
var location = new GLatLng(latitude, longitude); | |
map.setCenter(location, startZoom); | |
addMarker(latitude, longitude, description); | |
} | |
} | |
window.onload = init; | |
window.unload = GUnload; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment