Skip to content

Instantly share code, notes, and snippets.

@ccarpenterg
Created September 1, 2009 19:48
Show Gist options
  • Save ccarpenterg/179329 to your computer and use it in GitHub Desktop.
Save ccarpenterg/179329 to your computer and use it in GitHub Desktop.
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