Created
April 22, 2011 20:50
-
-
Save joshuamiller/937597 to your computer and use it in GitHub Desktop.
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 initialize() { | |
var map = new google.maps.Map(document.getElementById("map"), { | |
center: new google.maps.LatLng(81, -158.5), | |
zoom: 3, | |
disableDoubleClickZoom: true, | |
mapTypeControlOptions: { | |
mapTypeIds: ["nw"] | |
} | |
}); | |
map.mapTypes.set('nw', nwMapType); | |
map.setMapTypeId('nw'); | |
for (var i in locations) { | |
locations[i].glatlng = new google.maps.LatLng(locations[i].latitude, locations[i].longitude); | |
var marker = new google.maps.Marker({ | |
position : locations[i].glatlng, | |
map : map, | |
title : locations[i].title, | |
index : i | |
}); | |
var infowindow = new google.maps.InfoWindow({ | |
content: locations[i].content | |
}); | |
attachInfoWindow(marker, infowindow); | |
} | |
function attachInfoWindow(marker, infowindow) { | |
google.maps.event.addListener(marker, 'click', function() { | |
infowindow.open(map, marker); | |
}); | |
console.log(marker); | |
} | |
var center_myLatlng = new google.maps.LatLng(81, -158.5); | |
var center_marker = new google.maps.Marker({ | |
position: center_myLatlng, | |
map: map, | |
title:"Center" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment