地图标本可以自动确定贵方的中继部分应当被点击(即,如果你使图像具有透明背景的话,如果要达到你的超支类别,以确定在透明区域点击是否有效点击)。
你们应当把新闻部的听众添加到你所选的超支中,然后,如果这真的点击,就引发你们自己的地图AP。
例:
FooBar.prototype.onAdd = function() {
// Create a div and append it to a map pane.
var div = document.createElement( div );
div.style = "height: 100px; width: 100px";
this.getPanes().overlayLayer.appendChild(div);
// set this as locally scoped var so event does not get confused
var me = this;
// Add a listener - we ll accept clicks anywhere on this div, but you may want
// to validate the click i.e. verify it occurred in some portion of your overlay.
google.maps.event.addDomListener(div, click , function() {
google.maps.event.trigger(me, click );
});
// Position your overlay etc.
}