我試圖在Google Maps V3中放置多邊形頂部的MapLabel。我試圖將MapLabel zIndex設置爲2,將Polygon zIndex設置爲1,但沒有任何運氣。這是不是可能的,因爲多邊形並不真正遵循zIndex?在Google Maps V3中將MapLabel放置在多邊形頂部
我已經創建了一個對的jsfiddle你們來看看:http://jsfiddle.net/7wLWe/1/
解決方案:在maplabel.js
變化:
mapPane.appendChild(canvas);
到:
floatPane.appendChild(canvas);
的原因是因爲floatPane
高於所有地圖圖層(窗格6)
http://code.google.com/apis/maps/documentation/javascript/reference.html#OverlayView
你應該張貼您的解決方案作爲一個答案,並接受它,去幫助別人,將來 – duncan 2012-02-08 10:08:23
+1, - 尼斯找到人 – RocketDonkey 2012-11-14 09:50:43
更改爲markerLayer而不是floatPane如果你使用拖動或編輯。 – hammurabi 2016-09-26 15:03:17