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

Wrap camera heading #7724

Merged
merged 2 commits into from
Jan 24, 2017
Merged

Wrap camera heading #7724

merged 2 commits into from
Jan 24, 2017

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Jan 14, 2017

Fixed an issue causing MGLMapView’s camera’s heading to be set to a negative value, indicating an undefined heading, when the map view faces northwest. The heading is now wrapped to between zero and 360 degrees, for consistency with MGLMapView’s direction property.

Fixes #7723.

/cc @friedbunny

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS navigation For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general labels Jan 14, 2017
@1ec5 1ec5 added this to the ios-3.4.1 milestone Jan 14, 2017
@1ec5 1ec5 self-assigned this Jan 14, 2017
@1ec5 1ec5 requested a review from incanus January 14, 2017 18:41
@mention-bot
Copy link

@1ec5, thanks for your PR! By analyzing this pull request, we identified @incanus, @boundsj and @friedbunny to be potential reviewers.

@1ec5
Copy link
Contributor Author

1ec5 commented Jan 14, 2017

I put this PR on the v3.4.1 milestone, because it’s so close to the v3.4.0 release and we shipped this regression in v3.3.0. However, I’m open to moving it up to v3.4.0 if there’s a need for the fix sooner.

[tester.mapView twoFingerRotateAtPoint:tester.mapView.center angle:-45];

XCTAssertGreaterThanOrEqual(fabs(tester.mapView.direction - startAngle),
-20,
Copy link
Contributor

Choose a reason for hiding this comment

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

The absolute value of one number will always be greater than or equal to another, negative number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1fa4c07.

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 navigation For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants