Using SwiftUI, MapKit and the Map()
view in iOS 17, I'm adding markers and annotations to the map instance. However it seems regardless of what order they are added, they are rendered with random Z-index values. I've not found any modifiers to specify any kind of priority.
Is there a way to declare Z-index priority of Marker
and Annotation
views?
@DancesWithDingo From my experiments the z-index of annotations is determined by their latitude value. The lower the value, the higher the z-index. So, for example. This: CLLocationCoordinate2D(latitude: 37.66183, longitude: -122.37757 will overlap this: CLLocationCoordinate2D(latitude: 37.736555, longitude: -122.256918