I have a MKMapView where the user can choose if he wants to use Apple Maps or an alternative map source. On that map I draw a MkPolyline showing the current heading. That line updates once a second by removing and adding the line. My app does a lot of other calculations, and while in debug mode the CPU level is around 20% when using Apple maps. If I add the MKTileOverlay to use an alternative map source, the CPU level increases to around 140%.
Does anybody know the reason for this? What's different when using a MkTileOverlay?
Had a same problem, took me a while to figure it out but here it is: This will happen when your tile overlay's
override func loadTile(at path: MKTileOverlayPath, result: @escaping (Data?, Error?) -> Void)has an error (for example because of url error or image decoding) and theresultcallback's first parameter is set null. To solve it, I return an empty image data instead. Here is an example: