Skip to content

Commit

Permalink
Prevent double voice instruction before rerouting (#1215)
Browse files Browse the repository at this point in the history
* Prevent voice instruction before rerouting

* change
  • Loading branch information
Bobby Sudekum authored Mar 9, 2018
1 parent f839ae1 commit 0d76c55
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MapboxCoreNavigation/RouteController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,11 @@ extension RouteController: CLLocationManagerDelegate {
}

// Check and see if the user is near a future step.
guard let nearestStep = routeProgress.currentLegProgress.closestStep(to: location.coordinate),
nearestStep.index != routeProgress.currentLegProgress.stepIndex else {
guard let nearestStep = routeProgress.currentLegProgress.closestStep(to: location.coordinate) else {
return false
}

if nearestStep.distance < radius {
if nearestStep.distance < RouteControllerUserLocationSnappingDistance {
advanceStepIndex(to: nearestStep.index)
return true
}
Expand Down

0 comments on commit 0d76c55

Please sign in to comment.