iosobjective-cmapboxcatiledlayer

Mapbox: tile source with every second zoom level


I am using Mapbox-iOS-SDK with an MBTiles file containing every second zoom level to reduce its file size.

The problem is that, whilst zooming in, Mapbox removes the previous zoom level tiles before loading the next level. If this level is not available I end up with an empty map.

I would like, for example, zoom level 15 to stay until zoom level 17 has been loaded (because 16 is missing).

Mapbox is using a CATiledLayer to draw the tiles. I can't see a way right now to prevent the old tiles from being removed.


Solution

  • You might be able to solve this with mapView.missingTilesDepth = 2, which will consult zoom levels up to 2 less than the current zoom when rendering tiles.