-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're changing the unit of the CameraOptions::angle
from radians to degrees, but the comment didn't change:
mapbox-gl-native/include/mbgl/map/camera.hpp
Lines 30 to 32 in 7bf29bb
/** Bearing, measured in radians counterclockwise from true north. Wrapped | |
to [−π rad, π rad). */ | |
optional<double> angle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for streamlining degrees vs radiants, we have a couple of instrumentation tests on Android that depend on this code and they aren't affected. 👍 from my end.
3d68be8
to
e9373ef
Compare
e9373ef
to
efac5b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the belated review; I was away for a bit. This PR didn’t replace usage of MGLRadiansFromDegrees()
or MGLDegreesFromRadians()
, which resulted in #13210.
@@ -1970,7 +1970,7 @@ - (MGLMapCamera *)cameraByRotatingToDirection:(CLLocationDirection)degrees aroun | |||
MGLMapCamera *camera; | |||
|
|||
mbgl::ScreenCoordinate anchor = mbgl::ScreenCoordinate { anchorPoint.x, anchorPoint.y }; | |||
currentCameraOptions.angle = degrees * mbgl::util::DEG2RAD; | |||
currentCameraOptions.angle = degrees; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This incidentally fixes a missing -
that caused -[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]
to get called with an incorrectly rotated “to” camera.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These accidentally fixed bugs should be noted in the iOS map SDK v4.5.0 and macOS map SDK v0.12.0 changelogs.
Glad this helped @1ec5 🎉 |
Introduces a Memento-like RendererState object that will be responsible for fetching renderer state-related data (being camera positioning the first in the list), while preserving the encapsulation of
mbgl::UpdateParameters
.This PR also fixes an inconsistency in our public APIs, in which
mbgl::CameraOptions
should only accept (and outputs) bearing and pitch values in degrees. We should only use such values in radians internally./cc @kkaefer @tmpsantos @1ec5 @tobrun