Created
April 20, 2016 15:58
-
-
Save marmelroy/0fee54bfe69bfbfcbbf7057298fca046 to your computer and use it in GitHub Desktop.
Calculating MKMapCamera's altitude for a distance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let altitude = distance*tan(M_PI*(75.0/180.0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@plindberg
Thank you. I've found a related answer on stackoverflow and came up with quite a similar solution.
https://stackoverflow.com/a/21034410/6292624
Wanted to update that on my devices (iOS 13) and simulators (13, 14) max zoom never causes that much delta with target value. In my case minCenterCoordinateDistance ~875 and max zoom value is ~890, so probably mapKitBugAdjustmentFactor should be removed or significantly reduced.