Google Maps: How can I change the z-index of a Marker?

Salman A picture Salman A · Mar 6, 2010 · Viewed 23.4k times · Source

There are about 100 markers on a google map plus there is one special marker that needs to be visible. Currently, the markers around it hide it totally or partially when the map is zoomed out. I need that marker to be fully visible and I think keeping it on top of all other markers should do the trick. But I cannot find a way to modify its stacking order (z-index).

Answer

jhanifen picture jhanifen · Aug 31, 2011

This is for Google Maps API 2.

For Google Maps API 3 use the setZIndex(zIndex:number) of the marker.

See: http://code.google.com/apis/maps/documentation/javascript/reference.html#Marker