0
我在地圖上有多個引腳,每個引腳有兩個與之關聯的事件(鼠標單擊和鼠標懸停)。但只有鼠標懸停而不是點擊。以下是我正在使用的代碼。將鼠標點擊和鼠標懸停事件附加到Bing地圖圖釘不起作用
//Creating the pushpin
var pin = new Microsoft.Maps.Pushpin(loc);
pin.Description = "Some address";
Microsoft.Maps.Events.addHandler(pin, 'mouseover', function(e){
if (e.targetType == 'pushpin') {
self.bingInfobox.setLocation(e.target.getLocation());
self.bingInfobox.setOptions({
visible: true, title: e.target.Title, description: e.target.Description });
}
});
Microsoft.Maps.Events.addHandler(pin, 'click', function(e){
if (e.targetType == 'pushpin') {
// some functionality..
}
});
請建議..
self.bingInfobox是指Bing地圖的內置信息框,還是您添加的自定義實現? –
是的,self.bingInfobox僅涉及內置信息框.. – mohanrajt