Mapbox maps - offline tiles cache for ios

909 views Asked by At

I'm using mapbox SDK, trying to cache mapbox street-map tiles (not MBTiles). I've tried using the code in this thread with no success - am getting null for *tileSource:

NSString *fullPath = [[NSBundle mainBundle] pathForResource:@"mapbox" ofType:@"json"];
NSString *tileJSON = [NSString stringWithContentsOfFile:fullPath encoding:NSASCIIStringEncoding error:nil];
RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithTileJSON:tileJSON];

and I couldn't find any other code examples doing something similar.

What I need to do, in general, is to cache tiles for specific areas, and then be able to use it couple of weeks later.

Any code example or point to the right direction would be life saving!

1

There are 1 answers

0
incanus On

Are you sure that both your fullPath and tileJSON are non-nil as well?