mapbox / DEPRECATED-mapbox-ios-sdk

REPLACED – use https://www.mapbox.com/ios-sdk instead
https://github.com/mapbox/mapbox-gl-native
Other
322 stars 8 forks source link

RMMapView assign RMDatabaseCache with files at MBXOfflineMapDatabase path #545

Open paperview opened 9 years ago

paperview commented 9 years ago

First of all, I'm wondering if this would even work in principal.

In the

- (void)offlineMapDownloader:(MBXOfflineMapDownloader *)offlineMapDownloader didCompleteOfflineMapDatabase:(MBXOfflineMapDatabase *)offlineMapDatabase withError:(NSError *)error

method I am trying to assign tiles I downloaded for a certain region to my RMMapView's tile cache, so that it will use those tiles when offline. I'm doing something like this

RMDatabaseCache *cache = [[RMDatabaseCache alloc] initWithDatabase:offlineMapDatabase.path];

and then I need to assign that to self.mapView.tileCache

I can't figure out how to do this.

paperview commented 9 years ago

I want to continue using RMMapView from the mapbox-ios-sdk instead of useing MKMapView for the ease of drawing the LineStrings I have in my map in the - (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation delegate method

paperview commented 9 years ago

The answer may be as simple as [self.mapView.tileCache addCache:cache] still finding out if this will actually work.