Google Maps API - InfoBubble的事件侦听器不起作用

Ron*_*Ron 3 events google-maps-api-3 infobubble

我需要一个等待点击的事件监听器.不幸的是,它的工作方式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
    });
Run Code Online (Sandbox Code Playgroud)

这是我的倾听者:

google.maps.event.addListener(infoBubble, 'click', function(){

        console.log("noodle");  
    });
Run Code Online (Sandbox Code Playgroud)

顺便说一句,Firebug没有报告任何错误.

Mar*_*ius 6

试试这个:

$(infoBubble.bubble_).live("click", function() {
    console.log('clicked!');
});
Run Code Online (Sandbox Code Playgroud)