Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setOverheadCameraView for short routes #1456

Merged
merged 2 commits into from
May 29, 2018
Merged

Conversation

bsudekum
Copy link
Contributor

Addresses the bug in #1455

Previously, if the user only had a few meters left on the route, we'd flip up the camera, then break early and never actually set the correct center coordinate.

Now, if we detect there is not much left on the route, we simple flip the camera and set the center coordinates to the user.

/cc @mapbox/navigation-ios

@bsudekum bsudekum added this to the v0.18.0 milestone May 24, 2018
@@ -1030,14 +1030,25 @@ open class NavigationMapView: MGLMapView, UIGestureRecognizerDelegate {
let line = MGLPolyline(coordinates: slicedLine, count: UInt(slicedLine.count))

tracksUserCourse = false

// If the user has a short distance left on the route, prevent the camera from zooming all the way.
// `MGLMapView.setVisibleCoordinateBounds(:edgePadding:animated:)` will go beyond what is convient for the driver.
Copy link
Contributor

Choose a reason for hiding this comment

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

will go beyond what is convient for the driver.

did you mean to say convenient to the driver?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it'd be inconvenient for the map to continue zooming past what is comprehensible.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bsudekum oh okay. There's a typo convient for should convenient to

@bsudekum bsudekum merged commit bb2a4ba into master May 29, 2018
@bsudekum bsudekum deleted the fix-short-overview branch May 29, 2018 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants