I'm building a google maps web site with markers placed onto the map. Some times the markers overlap so I want to be able to interactively bring to the front specific markers.
I can use setZIndex() for this. But I need to know the initial max zindex of all the markers. getZIndex() is no use as it doesnt seem to return anything unless youve already called setZIndex().
It would be tempting to say "just start with a very big number" but I believe Google uses latitude or something to calculate the initial zIndex so the maximum zindex may vary? Making this scheme risky.
Does anyone know what the max initial zIndex will be for N markers in Google Maps V3?
You can use the constant MAX_ZINDEX to ensure that the marker will display on top.
marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1);
Search the reference of the constant in the Google Maps API V3 Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With