简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM