รบกวนพี่ๆ TC ช่วยดูให้ทีครับ คือผมนำตัวแปร point ไปไช้แล้ว ติด () มาด้วย ผมต้องลบตรงไหนครับ
fCode
unction load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
geocoder = new GClientGeocoder();
map.addMapType(G_PHYSICAL_MAP);
map.removeMapType(G_NORMAL_MAP);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(13.42456,99.95671), 17);
GDownloadUrl("ajax_markers.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 bounds = new GLatLngBounds();
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var type = markers[i].getAttribute("type");
var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")) ,
parseFloat(markers[i].getAttribute("lng")));
var marker = createMarker(point, name, address, type);
map.addOverlay(marker);
var lat_2;
var long_2;
var point = '(99.998,15.746)';
if(point){
var match = /\((.*),(.*)\)/.exec(point)
pointOutput = (match[1]+","+match[2]);
lat_2 = match[1];
long_2 = match[2];
}