This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
MGLMapCamera misinterprets eye coordinate #12967
Labels
bug
iOS
Mapbox Maps SDK for iOS
macOS
Mapbox Maps SDK for macOS
MapKit parity
For feature parity with MapKit on iOS or macOS
navigation
For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
+[MGLMapCamera cameraLookingAtCenterCoordinate:fromEyeCoordinate:eyeAltitude:]
calculates a pitch in radians and passes it into-initWithCenterCoordinate:altitude:pitch:heading:
, which expects the pitch in degrees, so the resulting MGLMapCamera has much less of a pitch than expected, the wrong heading, and a shorter viewing distance – so theeyeCoordinate
parameter doesn’t have the intended effect. If the tangent happened to be negative, then MGLMapView would ignore the pitch altogether.mapbox-gl-native/platform/darwin/src/MGLMapCamera.mm
Lines 35 to 36 in 66e95ac
mapbox-gl-native/platform/darwin/src/MGLMapCamera.mm
Line 40 in 66e95ac
This significant discrepancy has apparently always been present in the MGLMapCamera implementation, since #2193. Unlike #12943, I think it would be tenable to fix the bug in-place, because the developer’s intent by using this method is pretty clear.
/cc @mapbox/maps-ios @d-prukop
The text was updated successfully, but these errors were encountered: