-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Public API to convert between zoom levels and altitudes #5583
Comments
I noticed that function. Not sure if it's the best thing to expose publicly. It had a difficult signature. Though an API in that direction would be needed. |
Just some perspective from an iOS SDK newbie: I recently made some local changes to the iOS bench app, and I got hung up on the altitude-based API while trying to do what I thought would be a simple 10 second zoom animation. The solution I ended up with is obviously non-optimal:
I saw |
Ah, the ol’ set-and-revert dance (also described in mapbox/ios-sdk-examples#65 (review)). It’s worth noting that it’s sometimes possible to avoid this issue entirely by reconsidering whether a zoom level is the best way to express the target viewport. Sometimes an altitude or coordinate bounds better captures the intent. But in cases where you really do want to show tiles at a specific zoom level (perhaps in order to reach a certain camera function stop), |
Are there any plans to implement this? 😅 |
What's the current status of this? Need a pull request? |
If you have a pull request, we would be happy to review it @datwelk ! |
Hi, any updates on this feature? |
Internally, the iOS and macOS SDKs use
MGLAltitudeForZoomLevel()
to convert from a zoom level to an altitude given the map view’s current state. This functionality would be useful for developers who want to animate to a given zoom level and pitch or perform other zoom-level-dependent calculations.Not sure whether
MGLAltitudeForZoomLevel()
is the best API to expose publicly or whether we should design a wrapper around it in MGLMapCamera./cc @dapetcu21
The text was updated successfully, but these errors were encountered: