我正在使用 MapBox SDK,并且我已经生成了我的 .mbtiles 文件。但是当我将它与 RMMapView 一起使用时,它只能加载其中的一小部分。为什么没有加载所有的瓷砖?例如,在缩放级别 0 中应该有 16 个图块,但我只能看到 2 个。
- (void)viewDidLoad
{
[super viewDidLoad];
RMMBTilesSource *offlineSource = [[RMMBTilesSource alloc] initWithTileSetURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"nn" ofType:@"mbtiles"]]];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:offlineSource];
// default zoom
mapView.zoom = 0;
// hard code minimal zoom. Try to run in without it to see what happens.
mapView.minZoom = 0;
mapView.maxZoom = 3;
// hide MapBox logo
mapView.showLogoBug = NO;
// hide bottom right "i" icon
[mapView setHideAttribution:YES];
mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
mapView.adjustTilesForRetinaDisplay = YES; // these tiles aren't designed specifically for retina, so make them legible
[self.view addSubview:mapView];
// Do any additional setup after loading the view, typically from a nib.
}