mapbox / DEPRECATED-mapbox-ios-sdk

REPLACED – use https://www.mapbox.com/ios-sdk instead
https://github.com/mapbox/mapbox-gl-native
Other
323 stars 8 forks source link

Map rendering from mbtiles is very slow #644

Open wasatchtechnology opened 9 years ago

wasatchtechnology commented 9 years ago

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 commented 9 years ago

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

friedbunny commented 9 years ago

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 commented 9 years ago

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 https://github.com/mapbox/mapbox-ios-sdk/issues/644#issuecomment-118140207 .

friedbunny commented 9 years ago

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

wasatchtechnology commented 9 years ago

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 commented 9 years ago

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