Can anyone explain the exact syntax used to set the z-index for a marker using the Google Maps API (Version 3)?
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.
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.
In the MarkerOptions:
var marker = new google.maps.Marker({ .... zIndex: 100 });
Or via the Marker setter:
marker.setZIndex(100);
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