我需要一个等待点击的事件监听器。不幸的是,它与 InfoWindows
一起工作的方式似乎在这里不起作用......
好吧,这是我的 InfoBubble
:
var infoBubble = new InfoBubble({
map: map,
content: $('#my-div').html(),
position: new google.maps.LatLng(areas[area].lat, areas[area].lng),
shadowStyle: 1,
padding: 0,
borderRadius: 0,
arrowSize: 10,
borderWidth: 1,
borderColor: '#ccc',
disableAutoPan: true,
hideCloseButton: true,
arrowPosition: 15,
arrowStyle: 0
});
这是我的听众:
google.maps.event.addListener(infoBubble, 'click', function(){
console.log("noodle");
});
顺便说一句,Firebug 没有报告任何错误。
最佳答案
试试这个:
$(infoBubble.bubble_).live("click", function() {
console.log('clicked!');
});
关于events - Google Maps API - InfoBubble 的事件监听器不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12368902/