在应用程序中我有一些mapViews
,我想支持离线模式(缓存)。所以:用户安装的应用程序,主屏幕包含mapView
,它应该缓存它。然后用户关闭Wi-Fi和3G,并试图看看另一个mapView
(另一个viewController
)。它现在没有下载。但主屏幕的地图没问题。我以错误的方式缓存?Mapbox缓存在iOS应用程序
配置地图的代码是一样的:
[[RMConfiguration sharedInstance] setAccessToken:@"pk.***"];
RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithMapID:kMapboxMapID];
[tileSource setCacheable:YES];
[self.mapView.tileCache setBackgroundCacheDelegate:self];
[self.mapView.tileCache beginBackgroundCacheForTileSource:tileSource southWest:CLLocationCoordinate2DMake(55.767363, 37.592843) northEast:CLLocationCoordinate2DMake(55.799801, 37.671229) minZoom:11 maxZoom:11];
self.mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
self.mapView.delegate=self;
[self.view addSubview:self.mapView];
当用户处于离线状态并尝试访问地图时,图块源始终为“无”。 – mikezs 2015-02-17 20:39:57