Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 415
Zabs Avatar asked Jan 26 '12 16:01

Zabs


People also ask

How do you customize a marker in maps?

For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.

How do I get a marker position on Google Maps?

You can add a simple marker to the map at a desired location by instantiating the marker class and specifying the position to be marked using latlng, as shown below.


1 Answers

In the MarkerOptions:

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

Or via the Marker setter:

marker.setZIndex(100); 
like image 178
ori Avatar answered Oct 14 '22 03:10

ori