Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 476
jetgrrrl Avatar asked Oct 19 '25 09:10

jetgrrrl


1 Answers

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.

like image 180
plexer Avatar answered Oct 22 '25 03:10

plexer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!