discourse-legacysite-perl/site/roadshow/gmaps_allroadshow.js

22 lines
990 B
JavaScript
Raw Normal View History

2024-06-17 12:44:21 +00:00
<script type="text/javascript" src="http://www.slowtwitch.com/googlemaps/util.js"></script>
<script type="text/javascript">
function initializeRoadshowMap() {
//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("http://www.slowtwitch.com/googlemaps/roadshow_xml.php", 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")});
//alert (latlng);
}
});
}
</script>