Mapbox Background Tile Cache Stops Without Fail

436 views Asked by At

I am trying to offline my map using Mapbox and Xcode, however it seems to get stuck during the download process without any warning. I use this code to check what tile it's currently on:

- (void)tileCache:(RMTileCache *)tileCache didBackgroundCacheTile:(RMTile)tile withIndex:(int)tileIndex ofTotalTileCount:(int)totalTileCount
{
    NSLog(@"Caching Tile %i", tileIndex);
}

However the map always gets stuck caching tile 495 but never hits

- (void)tileCacheDidFinishBackgroundCache:(RMTileCache *)tileCache

or

- (void)tileCacheDidCancelBackgroundCache:(RMTileCache *)tileCache

I had this issue before and fixed it by creating a new project on the Mapbox website. I don't want to do this again as I have layers etc and this problem seems to occur if I don't use the map for a little while. Has anyone else had this issue or can anyone offer any advice as to how I can debug / counter this?

Thanks

2

There are 2 answers

1
Stephen Johnson On

I download and cache MapBox tiles and I have never run into a problem at tile 495. However, I don't do the downloading with the MapBox SDK so my situation is different from yours. I have downloaded 10,000's of titles without problems.

Here is who you should ask about this problem https://twitter.com/incanus77. He should be able to help you.

0
incanus On

@incanus77 here :-)

There's something specific to your setup going on here; higher tile counts should be possible. I would recommend debugging stepping through the code up to that delegate callback to see what really happens on that last tile that's successful.