0
안녕하세요, 저는 아약스 메서드를 사용하지 않은 Google 예제를 기반으로 만들려고하고있는 다음 함수가 있습니다. 내 문제가 있습니다.} 나는 생각한다. 그리고 내가 잠시 동안 이것에 있었기 때문에 내가 잘못 가고있는 곳을 보았던 어떤 사람과 나는 할 수 있었다.Jquery Ajax 및 Google Maps v3 API 마커 - a {또는 (
아래에 표시된 줄에는 구문을 처리 할 수는 있지만 플래그가 지정되었습니다.
많은 감사합니다.
테란
// http://code.google.com/apis/maps/articles/phpsqlajax_v3.html
// Change this depending on the name of your PHP file
function showGetResultkml()
{
var result = null;
var scriptUrl = "http://www.kml";
$.ajax({
url: scriptUrl,
type: 'get',
dataType: 'xml',
async: false,
success: function(data) {
result = data;
var xml = data.responseXML;
var markers = xml.documentElement.getElementsByTagName("marker");
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 google.maps.LatLng(
parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var html = "<b>" + name + "</b> <br/>" + address;
var icon = customIcons[type] || {};
var marker = new google.maps.Marker({
map: map,
position: point,
icon: icon.icon,
shadow: icon.shadow
});
bindInfoWindow(marker, map, infoWindow, html);
}
// problem with this bracket
});
// problem with this bracket
}
function bindInfoWindow(marker, map, infoWindow, html) {
google.maps.event.addListener(marker, 'click', function() {
infoWindow.setContent(html);
infoWindow.open(map, marker);
});
}
}
});
return result;
}
감사합니다 ... 그냥 잠깐보고 내가 손을 볼 수 없습니다 어떻게 바뀌 었습니까? –
'}'이 잘못 배치되었습니다. –
아 .... 정말 고마워. –