// this is a javaascript test file alert("test"); function getFM_Markers(mydata){ xy = new Array(0,0); var urlstr="tor49-v3.php?myvalue="; var request = GXmlHttp.create(); request.open('GET', urlstr + mydata, true); // request XML from PHP with AJAX call request.onreadystatechange = function () { if (request.readyState == 4) { var xmlDoc = request.responseXML; locations = xmlDoc.documentElement.getElementsByTagName("sites"); markers = []; if (locations.length){ for (var i = 0; i < locations.length; i++) { // cycle thru locations xy[0] = xy[0] + parseFloat(locations[i].getAttribute("lat")); xy[1] = xy[1] + parseFloat(locations[i].getAttribute("lng")); markers[i] = new GMarker(new GLatLng(locations[i].getAttribute("lat"),locations[i].getAttribute("lng"))); markers[i].infowindow = "Station: "+locations[i].getAttribute("ID"); markers[i].markerindex = i; markers[i].ID = locations[i].getAttribute("ID"); map.addOverlay(markers[i]); } if (document.getElementById("crit").value == "call") { xy[0] = xy[0]/parseFloat(locations.length); xy[1] = xy[1]/parseFloat(locations.length); var censite = new GLatLng(xy[0],xy[1]); map.setCenter(censite, 9); } if (document.getElementById("crit").value == "mycity") { xy[0] = xy[0]/parseFloat(locations.length); xy[1] = xy[1]/parseFloat(locations.length); var censite = new GLatLng(xy[0],xy[1]); map.setCenter(censite, 10); } }}} request.send(null); }