Positioning markers over the top of clusters; z-index not working

邮差的信 提交于 2019-12-22 12:59:06

问题


I've got some JSON data populating markers and then clustering using MarkerClusterer. I also have some alert type markers that don't cluster on purpose. Could someone please help me out with how to get the alert markers to display over the top of the cluster markers?

I've tried setting a z-index on the marker and using .getZIndex() returns the z-index I set however no matter how high I set it it's always positioned under the cluster marker.

Is there some sort of magic I'm missing? The clusters are created before the alerts.

Thank you


回答1:


Because clustered markers sit in the overlayMouseTarget pane, you would need to create your own markers in the same pane.

If you create a custom overlay (http://code.google.com/apis/maps/documentation/javascript/overlays.html#CustomOverlays) and add it to the overlayMouseTarget pane, you should be able to make the markers appear above the clustered markers using the CSS zIndex property.



来源:https://stackoverflow.com/questions/6894548/positioning-markers-over-the-top-of-clusters-z-index-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!