gpt4 book ai didi

ios - iOS 应用程序中的 Mapbox 缓存

转载 作者:行者123 更新时间:2023-11-29 12:28:15 24 4
gpt4 key购买 nike

在应用程序中我有一些mapViews,我想支持离线模式(缓存)。所以:用户安装的应用程序,主屏幕包含 mapView 并且应该缓存它。然后用户关闭 Wi-Fi 和 3G,并尝试查看另一个 mapView(另一个 viewController)。现在还没有下载。但是主屏幕的 map 没问题。我缓存的方式不对吗?

配置 map 的代码同上:

[[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];

最佳答案

如果您没有使用 RMTileCache 的下载方法来预取 map 区域,则只有当试图在第二个 View Controller 中查看的 map 区域是与第一个中看到的相同。

关于ios - iOS 应用程序中的 Mapbox 缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28440498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com