Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Map rendering from mbtiles is very slow #644

Open
wasatchtechnology opened this issue Jun 14, 2015 · 6 comments
Open

Map rendering from mbtiles is very slow #644

wasatchtechnology opened this issue Jun 14, 2015 · 6 comments

Comments

@wasatchtechnology
Copy link

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
Copy link
Author

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

@friedbunny
Copy link
Contributor

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?

@wasatchtechnology
Copy link
Author

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
jclayton@WasatchTech.com
WasatchTechnology@gmail.com
www.WasatchTech.com

On Thu, Jul 2, 2015 at 2:25 PM, Jason Wray notifications@github.com 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
#644 (comment)
.

@friedbunny
Copy link
Contributor

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

@wasatchtechnology
Copy link
Author

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

@drhaynes
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants