You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
MGLMapView.camera.heading goes negative when rotating to face northwest #7723
bugiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSnavigationFor the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
When you rotate an MGLMapView so that it faces anywhere between due north and due west, exclusive, its direction property is wrapped to between 0° and 360°, but its camera’s heading goes negative, indicating an invalid direction according to CLLocationDirection semantics. Therefore, if you then set the camera property of any map view to that MGLMapCamera, you wind up facing the wrong direction.
This regression was introduced in #4790 but was not addressed by df0d118.
-[MGLMapCamera isEqual:] (correctly) accounts for the heading without wrapping, and methods like -[MGLMapView setCamera:withDuration:animationTimingFunction:completionHandler:] bail if the current and new MGLMapCamera objects are identical. Therefore, I believe this regression could be a minor contributing factor to #7236 and #7723.
I say minor because the main code path that would be affected, through -didUpdateLocationSignificantlyAnimated:, would normally require the center coordinate to change significantly. So if there are any redundant calls to this method, this issue would indeed contribute to the problem, but the root cause still lies elsewhere.
bugiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSnavigationFor the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
Activity
1ec5 commentedon Jan 14, 2017
-[MGLMapCamera isEqual:](correctly) accounts for the heading without wrapping, and methods like-[MGLMapView setCamera:withDuration:animationTimingFunction:completionHandler:]bail if the current and new MGLMapCamera objects are identical. Therefore, I believe this regression could be a minor contributing factor to #7236 and #7723.I say minor because the main code path that would be affected, through
-didUpdateLocationSignificantlyAnimated:, would normally require the center coordinate to change significantly. So if there are any redundant calls to this method, this issue would indeed contribute to the problem, but the root cause still lies elsewhere.1ec5 commentedon Jan 24, 2017
Fixed in #7724 on the release-ios-v3.4.0 branch.