Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Remove redundant radian-degree conversions #13212

Merged
merged 2 commits into from
Oct 26, 2018
Merged

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Oct 26, 2018

Removed several radian-to-degree or degree-to-radian conversions in iOS and macOS map SDK code that were made redundant by #13123, resulting in incorrect map camera rotation and tilting on both platforms. Also added changelog entries for bugs inadvertently fixed by #13123.

Fixes #13210.

/cc @julianrex @brunoabinader

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Oct 26, 2018
@1ec5 1ec5 added this to the ios-v4.6.0-h-release milestone Oct 26, 2018
@1ec5 1ec5 self-assigned this Oct 26, 2018
@1ec5 1ec5 requested a review from julianrex October 26, 2018 22:01
@1ec5
Copy link
Contributor Author

1ec5 commented Oct 26, 2018

Apparently this PR also fixes an issue with the user dot quite literally flipping out on a tilted map.

/cc @friedbunny

@friedbunny
Copy link
Contributor

Indeed, this also fixes Jason’s Favorite Bug of the Year Nominee “Flippy Dot and the 3438 Degrees of Pitch”.

flippy dot

@1ec5 1ec5 merged commit f50d8db into master Oct 26, 2018
@1ec5 1ec5 deleted the 1ec5-camera-degrees-13210 branch October 26, 2018 23:25
@@ -1218,10 +1218,10 @@ - (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration
camera.centerCoordinate.latitude,
self.frame.size);
if (camera.heading >= 0) {
options.angle = MGLRadiansFromDegrees(-camera.heading);
options.angle = -camera.heading;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this negative sign: #13213.

Copy link
Contributor

@springmeyer springmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1ec5 - would it be possible to add a test for this code to prevent the possibility it could regress again after core changes?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set heading or pitch of map view on load
4 participants