Reputation: 5446
The tiles are loaded from disk via loadTileAtPath
/ URLForTilePath
with a subclassed MKTileOverlay
.
When setting the maximumZ
of the overlay, tiles beyond that level are (as expected) no longer loaded. However, the tiles of the level above also disappear. Any ideas?
Upvotes: 2
Views: 447
Reputation: 2722
It's been a while for me, but I had some issues with this in the past. I think it could be something with the internal caching or the overlays.
For example, if it happens to be the case that the tiles disappear at the transition from zoom level 20 to zoom level 21, and it is also the case that your tile source has a maximum zoom level of 20, then the behavior you're seeing could be a result of polylines invalidating portions of MKMapView's rendered tile cache.
It could be that what you're seeing might be happening because your tile source doesn't provide tiles at a high enough zoom level for the amount of zooming you're attempting to do. Normally Apple's MKMapView render cache provides some limited overzooming, but when you do something that triggers a new render (like adding lines), the render cache gets invalidated and the pseudo-overzooming stops working.
However, I also once saw a fix simply by changing the level for the overlay, Changed from "MKOverlayLevelAboveLabels" to [mapView addOverlay:overlay level:MKOverlayLevelAboveRoads];
I hope these suggestions can get you a bit further :)
Upvotes: 2