Well, there is a bug in Apple’s MapKit since iOS 13.2, as the folks in developer community say: If you want to use non-Apple maps (e.g. OpenStreetMap®) occasionally tiles are not rendered although you supply the correct data in your sub-class of MKTileOverlayRenderer
. There seems to be no obvious systematic but if you scroll around the map you’ll soon find missing tiles. There seems to be no real fix for that problem and your app will not be notified if that happens; the delegate method mapViewDidFinishRenderingMap(mapView:fullyRendered:)
will always signal „fullyRendered
“ although tiles may be missing.
One proposal for a workaround calls the method overlayRenderer?.reloadData()
in the above mentioned delegate method each time the rendering is finished. Indeed, that fixes the problem but its a little bit heavy since every little pan of the map will lead to a flickering update. But it gave me an idea. At least for me, if I notice a missing tile I intuitively try to zoom in or out with the 2-finger gesture. So, my workaround for this problem is to reloadData()
if the zoom gesture is finished. That flickers as well but is not as annoying as the flickering after every pan.
1 2 3 4 5 |
@objc func pinchGestureRecognized(_ gesture: UIPinchGestureRecognizer) { if gesture.state == .ended { // the gesture is finished overlayRenderer?.reloadData() // reload the renderer data for bug in MapKit of missing tiles } } |
Hopefully Apple will fix that bug some time.