<script type="text/javascript">
//<![CDATA[
var map;
var geocoder;
var icontechnic = new GIcon();
icontechnic.image = 'http://upload.siamza.com/file_upload/modify/030110/494689.png';
icontechnic.iconSize =new GSize(50,50);
icontechnic.shadowSize = new GSize(50,50);
icontechnic.iconAnchor = new GPoint(6, 20);
icontechnic.infoWindowAnchor = new GPoint(5, 1);
var iconred = new GIcon();
iconred.image = 'http://upload.siamza.com/file_upload/modify/030110/494689.png';
iconred.iconSize =new GSize(50,50);
iconred.shadowSize = new GSize(50,50);
iconred.iconAnchor = new GPoint(6, 20);
iconred.infoWindowAnchor = new GPoint(5, 1);
var customIcons = [];
customIcons["ร้านแก๊ส"] = iconLightcoral;
customIcons["ห้างสรรพสินค้าบิ๊กซี"] = iconRed;
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
geocoder = new GClientGeocoder();
map.addMapType(G_PHYSICAL_MAP);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(13.820453,100.052919),14);
GDownloadUrl("xml/xml_customer.php", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName("marker");
var sidebar2 = document.getElementById('sidebar2');
sidebar2.innerHTML = '';
if (markers.length == 0) {
sidebar2.innerHTML = 'No results found.';
return;
}
var mapControl = new GMapTypeControl();
map.addControl(mapControl);
map.addControl(new GOverviewMapControl());//คอนโทรคเพิ่มแผนที่ขนาดเล็กแต่ย่อ
map.setUIToDefault() //การเพิ่มคอนโทรลของ Scrollwhell Zoomming ตั้งค่าเริ่มต้นแบบ Gmap เลย
var bounds = new GLatLngBounds();
for (var i = 0; i < markers.length; i++) {
var id_icon = markers[i].getAttribute("id");
var type_icon = markers[i].getAttribute("type");
var name_icon = markers[i].getAttribute("name");
var address_icon = markers[i].getAttribute("add");
var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var marker = createMarker(point, type_icon, name_icon, address_icon,id_icon);
map.addOverlay(marker);
var lat = markers[i].getAttribute("lat");
var lng = markers[i].getAttribute("lng");