在應用程序中我有一些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