I'm trying to place a marker, but when I do it, this marker is placed behind of some markers set before (and over some others as well). I want to set it over all the markers, but I didn't find any property (like z-index) to achieve this.
This is the part of the code where I set the marker that stays behind the others:
GMSMarker *marker = [[GMSMarker alloc] init];
marker.animated=YES;
marker.position = CLLocationCoordinate2DMake(lat, lon);
marker.map = mapView_;
and this is the result:
Is there any property or way to place the green marker over all blue markers? I'm using Google Maps SDK version 1.3.0.
This is now supported via a
zIndex
property added to theGMSOverlay
class in version 1.4.0. From the release notes:Just set a high
zIndex
on your marker to have it drawn on top of all others. As stated by the property documentation here:The default
zIndex
for a marker is0
(at least in the current SDK version - I haven't seen it documented, but it's easy to test and confirm), so if you're not setting thezIndex
for most of your markers and have one that you want to place above all the others, all you need to do is: