回答

2

使用標記的mouseover事件處理程序和setIcon()方法。您可以使用dynamic icons從谷歌圖表API用於此目的,並更改chld屬性,使圖標成長:

enter image description here http://chart.googleapis.com/chart?chst=d_map_spin&chld=0.5|0|FF8800|15|_|

enter image description here http://chart.googleapis.com/chart?chst=d_map_spin&chld=0.6|0|FF8800|15|_|

enter image description here http://chart.googleapis.com/chart?chst=d_map_spin&chld=0.7|0|FF8800|15|_|

別t忘記設置適當的錨點!例如:

marker.setIcon(new google.maps.MarkerImage(
    'http://chart.googleapis.com/chart?chst=d_map_spin&chld=0.65|0|FF8800|15|_|', 
    null, 
    null, 
    new google.maps.Point(11, 43) // this is the proper anchor point for scale 0.65 
)); 
+0

截至2012年,這已被棄用。任何人都知道現代解決方案? – FRD

+0

如果你只是點擊你自己的鏈接,你會看到。 ;) – FRD

+2

http://stackoverflow.com/q/11318672/684229 – TMS

1

您可以使用自己的圖像作爲標記,然後利用標記圖像的scaledSize屬性在mouseover事件觸發時使其更大。

我不知道如何做到這一點,而不需要做一些更復雜的事情。

+0

你想通了嗎? +1如果它實際上工作..請讓我知道 –

+0

@ mmmshuddup對不起,我一直沒有在這一段時間工作。由於它已經有一年多的時間了,您可能會發現自那時起API已經改變/改進。 – Oliver

相關問題