How do I set the z-index of a marker in Google Maps API v3

Zabs picture Zabs · Jan 26, 2012 · Viewed 30k times · Source

Can anyone explain the exact syntax used to set the z-index for a marker using the Google Maps API (Version 3)?

Answer

ori picture ori · Jan 26, 2012

In the MarkerOptions:

var marker = new google.maps.Marker({ 
    ....
    zIndex: 100 
});

Or via the Marker setter:

marker.setZIndex(100);