21 lines
968 B
JavaScript
21 lines
968 B
JavaScript
<script type="text/javascript" src="http://www.slowtwitch.com/googlemaps/util.js"></script>
|
|
<script type="text/javascript">
|
|
function initializeFitterMap() {
|
|
//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/phpsqlajax_genxml2.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")});
|
|
}
|
|
});
|
|
}
|
|
</script> |