Issues showing MKPolygonRenderer at different zoom levels

Hello,


I am trying to render some polygons onto a MKMapView and have run into an interesting issue.


Given two MKPolygons:


- polyA, which is a plain MKPolygon, and

- polyB, which is actually a subclassed MKPolygon to contain two or more polygons


I can successfully use a MKPolygonRenderer and a subclassed MKPolygonRenderer to show these polygons on the view. However, if I zoom in past the 'state' level (roughly equivalent to zoom level 4) the polygons are not rendered (and even though I call 'mapView.add(overlay: MKOverlay)' it does not get called.


The strange thing is the regular MKPolygon is in fact rendered, and when I zoom back out, the custom MKPolygons return... I've checked that the subclassed boundingMapRect and coordinates are accurate.


Is this a bug? Am I misusing the class? Any help is welcome.


Thanks,

C.

Replies

> a subclassed MKPolygonRenderer


It may be helpful to show some code. I doubt anyone will be able to help based on your description of how you think it should work. The code (copied and pasted - not just summarized) shows how it actually works 🙂