2013-10-02 27 views
0

我正在使用MapBox SDK,並且我已經生成了我的.mbtiles文件。 但是,當我用RMMapView使用它時,它只能加載其中的一小部分。爲什麼不是所有的瓷磚都被加載? 例如,應該在縮放級別0 16瓦,但我只能看到2iOS7 RMMapView無法加載所有的瓦片

- (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. 
} 

回答

0

你是如何產生的MBTiles文件?你有沒有在另一個客戶端嘗試過,比如上傳到mapbox.com?您還可以在RMMBTilesSource中設置斷點以查看是否正在加載切片。