1
我正在使用Google Fusion Table API和Google Maps API。我有我的maP感謝Google Maps API,然後使用Google Fusion Table API創建圖層,效果很好。放大/縮小時使用Google Maps API更改Google Fusion Table API中的圖標
當我創建圖層時,我將markes定義爲「small_red」(小紅點),但thants也很棒。
var layer = new google.maps.FusionTablesLayer({query: {select: 'coordenadas', from: '1-zmpFV_oI7OBiq3iEyHyze7QBiBDZzdrxby_TYM', where: 'hide!=0'},map: map, suppressInfoWindows: true, styles: [{ markerOptions: {iconName: "small_red" }}]});
現在,你可以看到下面,我想更改圖標「large_red」(谷歌地圖正常的),當用戶放大,並回到「small_red」(再次,紅色圓點)當用戶放大放。
google.maps.event.addListener(map, 'zoom_changed', function() {
if(map.getZoom()>14){
//Change icon to large_red
} else {
//Back to small_red
}
});
這最後的代碼識別或退出事件變焦,然後我有一個if子句來驗證,如果變焦上升或下降,然後,這個問題,我不知道如何更改圖標從地圖上圖層上的標記開始。
在此先感謝您的幫助。