0

我正在使用 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.
}
4

1 回答 1

0

您是如何生成 MBTiles 文件的?您是否在其他客户端尝试过,例如上传到 mapbox.com?您还可以设置断点RMMBTilesSource以查看是否正在加载图块。

于 2013-12-04T22:25:55.720 回答