是否可以在 Google 地图(API v3)中的自定义叠加层上监听鼠标悬停事件?一个简单的例子:
function HWPMarker(map, coords, text) { […] }
HWPMarker.prototype = new google.maps.OverlayView();
HWPMarker.prototype.draw = function() { […] }
HWPMarker.prototype.onAdd = function() {
$(this.getPanes().overlayLayer).append(this.marker); // this.marker is a div
// THIS IS WHERE I TRY TO LISTEN TO THE MOUSEOVER EVENT
google.maps.event.addListener(this, 'mouseover', function(){ alert('mouseover') });
}
难道我做错了什么?还是无法在自定义叠加层上监听鼠标悬停?