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