MKMapView hybridFlyover mode on iOS 16 replicates polygons at north and south pole

I have an app that uses MKMapView with mapType set to .hybridFlyover. I overlay a lot of polygons onto the map globe. Starting in iOS 16 I see miniature polygons drawn at both the north and south poles. How do I fix this?

I also have this problem, or one similar.

let circleDiameterMeters = 3000000.0
let nspot = CLLocationCoordinate2D(latitude: 82.75752195981894, longitude: -33.25326661642988) //  Northern Greenland
let newCircle = MKCircle.init(center:nspot, radius:MaxCircleDiameterMeters/2)
self.mapView.addOverlay(newCircle)

This code created this MKCircle, 1,500km radius, centered in Greenland.

The view from the Arctic looks like:

The view from the Antarctic looks like:

You can see the strangeness in the rendering of this MKCircle, which instead of a circle, seems to be the top of the circle bending in on itself, proceeding through the center of the Earth, and coming out the other end.

Welcome to the amazing world of spherical geometry!

It looks to me as if they may be using “web mercator” internally; this has trouble between +/- 85 degrees and the poles.

@Leafboats, can you check what the boundingMapRect is for the MKCircle in your first screenshot? It looks to me as if the circle should extend beyond the north pole; I suspect the boundingMapRect is clipped at 90 degrees North. This would be a problem even if they weren’t using web mercator.

(I see that MKMapRect has some special handling for rects that cross -180 degrees longitude, but doesn’t seem to have anything similar for the poles.)

Wouldn’t life be easy if we lived on a flat earth!

MKMapView hybridFlyover mode on iOS 16 replicates polygons at north and south pole
 
 
Q