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

Delay region-related delegate methods until after map view has loaded #8260

Closed
jmkiley opened this issue Mar 2, 2017 · 4 comments
Closed
Labels
archived Archived because of inactivity iOS Mapbox Maps SDK for iOS refactor

Comments

@jmkiley
Copy link
Contributor

jmkiley commented Mar 2, 2017

-mapView:regionDidChangeAnimated: and -mapViewRegionIsChanging: (for example) can be called before the map view has finished loading. We may want to explore ways to prevent these methods from being called until after the map view has finished loading.

cc @boundsj

@jmkiley jmkiley added iOS Mapbox Maps SDK for iOS needs discussion refactor and removed needs discussion labels Mar 2, 2017
@boundsj
Copy link
Contributor

boundsj commented Mar 3, 2017

I think that, currently, the region change delegate methods get called in response to application code setting the camera or the MGLMapView itself doing its initial camera setup. There is currently nothing that enforces any order of these calls and there is no mechanism to queue camera related calls until after the style / map has finished loading.

@1ec5
Copy link
Contributor

1ec5 commented Mar 7, 2017

Does MapKit avoid calling -mapView:regionDidChangeAnimated: until after -mapViewDidFinishLoadingMap:?

@friedbunny
Copy link
Contributor

friedbunny commented Mar 7, 2017

Does MapKit avoid calling -mapView:regionDidChangeAnimated: until after -mapViewDidFinishLoadingMap:?

No, MapKit can call -mapView:regionDidChangeAnimated: before -mapViewWillStartRenderingMap: and -mapViewWillStartLoadingMap:, so our current behavior is consistent.

We should probably keep reenforcing to developers that they should avoid using -mapView:regionDidChangeAnimated: for anything that requires a fully-loaded map — or that they’ll need to keep track of if the map has finished loading themselves.

Relatedly: #2775 covers ways we are inconsistent with MapKit.

@stale stale bot added the archived Archived because of inactivity label Nov 11, 2018
@stale
Copy link

stale bot commented Nov 25, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Nov 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity iOS Mapbox Maps SDK for iOS refactor
Projects
None yet
Development

No branches or pull requests

4 participants