Hi,
On a SwiftUI map I render a mix of MapPolygon and MapPolyline. All overlays must use the same overlay level (.aboveLabels).
Goal: Ensure MapPolyline always renders on top of MapPolygon.
Issue:
- I order data so polylines are last and even render in two passes (polygons first, polylines second), all at .aboveLabels.
- Despite that, after polygons change (items removed/added based on zoom levels), I see polygons visually on top of polylines. It seems MapKit may batch/reorder rendering internally.
Questions:
- Is there a reliable way in SwiftUI Map to enforce z-order within the same overlay level so MapPolyline always appears above MapPolygon?
- If not, any known workarounds or best practices? (e.g. different composition patterns, using annotations with zIndex, or other techniques compatible with SwiftUI Map)
I know you can do this with UIKit, but first looking for a solution compatible with SwiftUI's version of MapKit.
Thanks