Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[iOS] setVisibleCoordinateBounds acts randomly #14991

Closed
RomainQuidet opened this issue Jun 24, 2019 · 8 comments
Closed

[iOS] setVisibleCoordinateBounds acts randomly #14991

RomainQuidet opened this issue Jun 24, 2019 · 8 comments
Labels
bug iOS Mapbox Maps SDK for iOS

Comments

@RomainQuidet
Copy link
Contributor

On iOS SDK 5.1, I'm using the method

  • (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds animated:(BOOL)animated;

to center the view on a region. Each time I call this, the camera animation does not end on the region fitting the view as it used to on SDK 4.9 and 5.0. See linked video.
SetVisibleBounds.mp4.zip

Steps to reproduce

  1. Create a region
  2. Move the map by hand
  3. Ask the map to center on the region

Expected behavior

The map shows the region fit in the view.

Actual behavior

The map show the regions with some offset, animation seems not to end correctly

Configuration

Mapbox SDK versions: 5.1
iOS/macOS versions: 12
Device/simulator models: both
Xcode version:10.2

@RomainQuidet
Copy link
Contributor Author

I have the same strange behavior with method

  • (void)showAnnotations:(NSArray<id > *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;

@RomainQuidet
Copy link
Contributor Author

@1ec5 it seems to me that region animation fail du to performance issue in MGLMapView.mm where setNeedsRerenderis called too many times, (CPU usage up to 80% without moving the map), creating new camera and then creating an animation collision.

@julianrex julianrex added iOS Mapbox Maps SDK for iOS bug labels Jun 24, 2019
@RomainQuidet
Copy link
Contributor Author

RomainQuidet commented Jun 24, 2019

Just start the demo app, tap on center user button, the map zoom in on the user. From here the CPU never goes down (50 to 90%) and the app creates in loop camera from the rendering...
See profiling below.

@RomainQuidet
Copy link
Contributor Author

Capture d’écran 2019-06-24 à 16 46 54

@julianrex
Copy link
Contributor

Thanks for the amazing feedback @RomainQuidet!

@m-stephen
Copy link
Contributor

@RomainQuidet I believe this issue has been fixed by #15130. You can try it and thanks again for your feedback!

@RomainQuidet
Copy link
Contributor Author

Thanks for the correction, I'll try SDK 5.2 beta as soon as possible!

@RomainQuidet
Copy link
Contributor Author

Hi, I did a 5.2 update on our app, the behavior is not anymore random, but still incorrect (systematic wrong offset computed)...

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

No branches or pull requests

5 participants