0
我在我的谷歌地圖上有一個FusionTablesLayer,它效果很好,但現在我必須添加一個懸停在它上面,我可以確定它是否可能。我已經看到了在不同多邊形上懸停的示例,但我無法使用它。懸停在Google地圖上的FusionTablesLayer中
我的層:
layer = new google.maps.FusionTablesLayer({
map: map,
suppressInfoWindows: true,
heatmap: { enabled: false },
query: {
select: "col0",
from: key,
where: CreateQuery(shownMunicipalities)
},
styles: [{
polygonOptions: {
fillColor: '#eeeeee',
fillOpacity: 0.5,
strokeColor: '#000000',
strokeOpacity: 0.2,
strokeWeight: 2
}
}, {
where: CreateQuery(activeMunicipalities),
polygonOptions: {
fillColor: '#00FF00',
fillOpacity: 0.3
}
}],
options: {
styleId: 2,
templateId: 2
}
});
我試着添加鼠標懸停事件的監聽器,但這似乎並沒有做幹啥。
google.maps.event.addListener(layer, 'mouseover', function (event) {
alert('hover');
});
我想要做不可能的事情嗎?
看爲[fusiontips]的代碼(http://code.google.com/p/gmaps-utility-gis/source/browse/trunk/fusiontips /),它會在鼠標懸停上顯示一個工具提示。不幸的是,這些例子似乎不再適用。 [本示例](https://developers.google.com/fusiontables/docs/samples/mouseover_map_styles)來自FusionTables文檔雖然(它仍然有效)可能會對您有所幫助。 – geocodezip