discourse-legacysite-perl/site/googlemaps/gmaps_all.js
2024-06-17 22:44:21 +10:00

21 lines
914 B
JavaScript

<script type="text/javascript" src="http://www.slowtwitch.com/googlemaps/util.js"></script>
<script type="text/javascript">
function initializeAllMap(myURL) {
//alert("mapping!");
var myLatlng = new google.maps.LatLng(40, -100);
var myOptions = {
zoom: 3,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
downloadUrl(myURL, function(data) {
var markers = data.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var latlng = new google.maps.LatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var marker = new google.maps.Marker({position: latlng, map: map, title: markers[i].getAttribute("name")});
}
});
}
</script>