[英]Error displaying infowindow for marker
我有一個ajax請求,它返回一個對象,但我試圖在infowindow中顯示對象數據,但是我收到一個錯誤:
錯誤
TypeError: a.get is not a function
Ajax請求 - 信息窗口未打開
google.maps.event.addListener(roadBlockMarker, "click", function () {
//passing data to dialog
$("#roadblockmarker-dialog").data("recordId", recordId);
if (clicks) { //Double Click
clicks = false; //reset
clearTimeout(clicksTimeout);
alert('Double Click');
//send an ajax request to scheck the roadblock status in order to enable and disable buttons on dialog
//set a reference to the marker clicked and then open the dialog for other options
$("#roadblockmarker-dialog").dialog("option", {
marker: this
}).dialog("open");
} else { //Single Click
clicks = true;
clicksTimeout = setTimeout(function () {
clicks = false;
alert('Single click');
//do double click function here
//Make ajax request to get infowindow data
$.ajax({
type: 'GET',
url: 'getRoadBlockInfoWindowData.htm',
async: 'false',
cache: 'false',
data: {
roadBlockId: recordId
},
dataType: 'json'
}).success(function (roadBlock) { //display info window here with data
var infowin = new google.maps.InfoWindow({
content: roadBlock.purpose
});
infowin.open(map, this);
console.log('success ' + roadBlock.purpose);
});
}, 300);
}
return false;
});
IIRC, this
行包含: infowin.open(map, this);
不是marker
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.