<script>
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(13.754059,100.493317),
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
}
downloadUrl("dbxml.php", function(data) {
var markers = data.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var lat = new google.maps.LatLng(parseFloat(markers[i].getAttribute("latitude"));
var lng = new google.maps.LatLng(parseFloat(markers[i].getAttribute("longitude")));
var marker = createMarker(markers[i].getAttribute("place_name"), latlng);
var id_place = markers[i].getAttribute("id_place");
}
});
}
function createMarker(place_name, latitudelongitude,id_place) {
var marker = new google.maps.Marker(
{position: latlng,
map: map,
icon: "https://dekdee.buu.ac.th/~s52530315/work/1165165831.gif"
});
google.maps.event.addListener(marker, "click", function() {
if (infowindow) infowindow.close();
infowindow = new google.maps.InfoWindow({สถานที่: "+ name_place+ "
});
infowindow.open(map, marker);
});
return marker;
}
</script>