DEPRECATED-mapbox-ios-sdk icon indicating copy to clipboard operation
DEPRECATED-mapbox-ios-sdk copied to clipboard

Map rendering from mbtiles is very slow

Open wasatchtechnology opened this issue 10 years ago • 6 comments

I'm using 1.6.1. The drawing of the tiles is very slow. I'm using offline map because there is no network. The mbtiles file is about 20 MB is size. When panning you have to wait and watch the tiles draw. Is there any way to speed this up? In 1.4 the performance seemed better. Would I be better served to go back to an older version?

Any help would be appreciated.

here is my map loading code;

- (void)viewDidLoad
{
    [super viewDidLoad];
    _minZoom = 12;
    _maxZoom = 17;
    _initialZoom = 13;

    NSString* path = [[NSBundle mainBundle] pathForResource:@"cayman13-16regular" ofType:@"mbtiles"];
    NSURL *url = [NSURL fileURLWithPath:path];

    RMMBTilesSource *fileSource = [[RMMBTilesSource alloc] initWithTileSetURL:url];
     _mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:fileSource];

    RMSphericalTrapezium mapBoundingBox = fileSource.latitudeLongitudeBoundingBox;
    [_mapView setConstraintsSouthWest:mapBoundingBox.southWest northEast:mapBoundingBox.northEast];

    _mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
    _mapView.adjustTilesForRetinaDisplay = YES; // these tiles aren't designed specifically for retina, so make them legible

    [_mapView setDelegate:self];

    //  Add the map to the view
    [self.view addSubview:_mapView];

    _mapView.maxZoom = _maxZoom;
    _mapView.minZoom = _minZoom;
    _mapView.zoom = _initialZoom;
}

wasatchtechnology avatar Jun 14 '15 13:06 wasatchtechnology

Wow, is this project dead? I know the GL is the shiny new thing but ...

wasatchtechnology avatar Jul 02 '15 17:07 wasatchtechnology

Not entirely dead. ;)

I can't replicate this performance issue, though. Testing on 1.6.1 in mapbox-ios-example with a 20MB .mbtiles, tile loading seems reasonably performant — better than 1.4.1, I daresay.

@wasatchtechnology The code you included is fairly straightforward, is there anything else happening in your app that might be affecting tile load times?

friedbunny avatar Jul 02 '15 19:07 friedbunny

Using a zoom of 11 it takes approx 4 seconds to refresh the screen on an iPhone 6+. I don't have the iPad here but of course the larger screen it takes even longer. You can watch the tiles paint. I've tested this in a iPhone 6+, iPad Mini and iPad 2 Air. I gave up on the universal app and went back to iPhone app because the performance is so poor. I did go back and try 1.4.1 and it wasn't noticeably different. There is no location service running at this time. Only 1 annotation on the map, nothing else going on in this map view.

Thanks for the reply.

Jon Clayton [email protected] [email protected] www.WasatchTech.com

On Thu, Jul 2, 2015 at 2:25 PM, Jason Wray [email protected] wrote:

Not entirely dead. ;)

I can't replicate this performance issue, though. Testing on 1.6.1 in mapbox-ios-example https://github.com/mapbox/mapbox-ios-example/commit/0a0a744351fadd095611817fd63ee7b9d3b04397 with a 20MB .mbtiles, tile loading seems reasonably performant — better than 1.4.1 https://github.com/mapbox/mapbox-ios-example/commit/173354dfabe83f1f9034231ee63fb5b35dd9e08e, I daresay.

@wasatchtechnology https://github.com/wasatchtechnology The code you included is fairly straightforward, is there anything else happening in your app that might be affecting tile load times?

— Reply to this email directly or view it on GitHub https://github.com/mapbox/mapbox-ios-sdk/issues/644#issuecomment-118140207 .

wasatchtechnology avatar Jul 02 '15 19:07 wasatchtechnology

You might try dropping your .mbtiles file into the demo app and seeing if performance is still poor.

friedbunny avatar Jul 02 '15 22:07 friedbunny

I just got a fresh MapBox sample and dropped my map into it. The performance is the same. Here is a QuickTime video of the map in a iPhone 6+. https://dl.dropboxusercontent.com/u/68614959/MapBoxDemoVideo.mov

wasatchtechnology avatar Jul 11 '15 01:07 wasatchtechnology

Just a +1 for the performance issues. Seeing the same in our project.

drhaynes avatar Aug 24 '15 14:08 drhaynes