我想要使用Google Maps v3獲取KMZ地標的突出顯示/懸停/鼠標懸停樣式。當我使用Google地球打開KMZ文件時,如果徘徊,合適的區域將根據預期更改爲highlightPlacemark樣式。但是當我將這個KMZ加載到Google Map對象上時,風格從不改變。突出顯示/ mouseover與KMZ文件中的多邊形斷開谷歌地圖v3
這裏是什麼風格的樣子:
<Style id="highlightPlacemark">
<LineStyle>
<color>ff000000</color>
</LineStyle>
<PolyStyle>
<color>a60000ff</color>
</PolyStyle>
</Style>
<StyleMap id="exampleStyleMap">
<Pair>
<key>normal</key>
<styleUrl>#normalPlacemark</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#highlightPlacemark</styleUrl>
</Pair>
</StyleMap>
<Style id="normalPlacemark">
<LineStyle>
<color>ff000000</color>
</LineStyle>
<PolyStyle>
<color>a6ffffff</color>
</PolyStyle>
</Style>
這裏的地標是什麼樣子:
<Placemark id="1">
<name>Test</name>
<Snippet maxLines="0"></Snippet>
<styleUrl>#exampleStyleMap</styleUrl>
<Polygon>
<extrude>1</extrude>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>
...lots of coordinates here...
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
此功能只在谷歌地球的工作還是有一種變通方法,使它在Google Maps v3中工作? 我能想到的唯一方法是創建單獨的多邊形對象,並分別向它們提供座標。這允許您使用Polygon類的mouseover事件。我寧願所有我的多邊形在1單個文件雖然...
在此先感謝!