SwiftUI Map overlay z-order: make MapPolyline consistently render above MapPolygon (aboveLabels)

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:

  1. I order data so polylines are last and even render in two passes (polygons first, polylines second), all at .aboveLabels.
  2. 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:

  1. Is there a reliable way in SwiftUI Map to enforce z-order within the same overlay level so MapPolyline always appears above MapPolygon?
  2. 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

SwiftUI Map overlay z-order: make MapPolyline consistently render above MapPolygon (aboveLabels)
 
 
Q