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

Move arrow when maneuver is swiped #532

Merged
merged 4 commits into from
Aug 24, 2017
Merged

Move arrow when maneuver is swiped #532

merged 4 commits into from
Aug 24, 2017

Conversation

bsudekum
Copy link
Contributor

Closes: #523

old

/cc @1ec5 @frederoni

@@ -541,6 +541,10 @@ extension RouteMapViewController: RoutePageViewControllerDelegate {
mapView.setUserTrackingMode(.followWithCourse, animated: true)
}
}

if let stepIndex = routeController.routeProgress.currentLeg.steps.index(where: { $0 == step }) {
mapView.addArrow(route: routeController.routeProgress.route, legIndex: routeController.routeProgress.legIndex, stepIndex: stepIndex)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll have to figure out how to handle multiple legs here. I'm not sure even what happens when you try to swipe past the current leg.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we get away with disallowing swiping to later legs for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that's how this will work right now. You will only be able to swipe on the current leg.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 This is fine

let maneuverCoordinate = routeProgress.currentLegProgress.upComingStep?.maneuverLocation
let polylineCoordinates = routeProgress.route.coordinates
func addArrow(route: Route, legIndex: Int, stepIndex: Int) {
let step = route.legs[legIndex].steps[stepIndex]
Copy link
Contributor

Choose a reason for hiding this comment

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

If the user manages to swipe past the last step in the leg or the last step in the route, this line will crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which you cannot do, but valid point, will guard.

@bsudekum
Copy link
Contributor Author

Merging after I merge #270

@bsudekum bsudekum merged commit ac41085 into master Aug 24, 2017
@bsudekum bsudekum deleted the arrow-step branch August 24, 2017 19:15
@ericrwolfe ericrwolfe modified the milestone: v0.7.0-4 Aug 29, 2017
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.

3 participants