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

fixes #1181: fix lat/lng & zoom ordering problems #1194

Merged
merged 2 commits into from
Apr 3, 2015

Conversation

incanus
Copy link
Contributor

@incanus incanus commented Apr 3, 2015

There were two things going on here:

  • On iOS, we limit the minimum zoom to 3 like MapKit so that we don't ever see world edges or a wrapping, repeating map. However, in various center set routines, we weren't checking that the level was at least 3 before trying to move the map, which could have limited it artificially and failed at setting the center desired. This abstracts out an MGLMinimumZoom constant since we use it in various places anyway, plus ensures that we are at the minimum zoom on iOS before changing viewport properties.
  • The second problem was more subtle. In C++, all of the setters and getters for center and zoom queried Map's transform except for getLatLng(), which queried state instead. This could cause things to be out of sync when setting properties one after the other in the same run loop pass.

/cc @kkaefer just to be sure.

@incanus incanus added bug iOS Mapbox Maps SDK for iOS labels Apr 3, 2015
@incanus incanus added this to the iOS Beta 1 milestone Apr 3, 2015
@1ec5
Copy link
Contributor

1ec5 commented Apr 3, 2015

Do these methods need to account for Map::getMinZoom() and Map::getMaxZoom() as well?

@incanus
Copy link
Contributor Author

incanus commented Apr 3, 2015

Good point @1ec5 — will adjust.

@incanus
Copy link
Contributor Author

incanus commented Apr 3, 2015

Adjusted for Map::getMinZoom() at each query, even though this is unlikely to change. I don't think we need to worry about max because we're not (yet?) talking about letting the (Cocoa) user cap this and it is meant to be in the 18-to-maybe-someday-20s range.

incanus added a commit that referenced this pull request Apr 3, 2015
fixes #1181: fix lat/lng & zoom ordering problems
@incanus incanus merged commit 999ebb3 into master Apr 3, 2015
@incanus incanus deleted the fix-lat-lon-zoom-order branch April 3, 2015 16:38
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

Successfully merging this pull request may close these issues.

2 participants