Skip to content

Comments

Improve departure announcement#654

Merged
bsudekum merged 2 commits intomasterfrom
depart
Sep 28, 2017
Merged

Improve departure announcement#654
bsudekum merged 2 commits intomasterfrom
depart

Conversation

@bsudekum
Copy link
Contributor

We've been omitting departure instructions like Head west on foo street.

This change now makes departure instructions:

  • Upcoming maneuver is > 2000 meters: Continue west on foo street for 5 miles.
  • Upcoming maneuver is relatively close, less than 2000 meters: Head west on foo street, then in 0.7 miles, turn right onto bar street.
  • Upcoming maneuver is very close: Turn right onto bar street.

Note, this only can occur when on the departure step and the alert level is .depart or .low.

/cc @1ec5 @frederoni @ericrwolfe

let isDeparture = routeProgress.currentLegProgress.currentStep.maneuverType == .depart && alertLevel == .depart
let didCompleteManeuver = routeProgress.currentLegProgress.currentStep.distance > 2_000 && routeProgress.currentLegProgress.alertUserLevel == .low
if isDeparture || didCompleteManeuver {
let isDeparture = routeProgress.currentLegProgress.currentStep.maneuverType == .depart && (alertLevel == .depart || alertLevel == .low)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename this variable to isStartingDeparture to reflect its narrower scope.

if isDeparture || didCompleteManeuver {
let isDeparture = routeProgress.currentLegProgress.currentStep.maneuverType == .depart && (alertLevel == .depart || alertLevel == .low)
if let currentInstruction = currentInstruction, isDeparture {
if routeProgress.currentLegProgress.currentStep.distance > 2_000 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pull this number out into a constant and document it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be based on the step's overall distance or the distance remaining to the maneuver? Also, what happens if the user is a significant distance from the departure point, like in a parking lot – how does that affect the behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, what happens if the user is a significant distance from the departure point, like in a parking lot – how does that affect the behavior?

Let's pull this out into a different PR.

@bsudekum
Copy link
Contributor Author

@1ec5 updated, pulling #654 (comment) into a followup task.

@bsudekum bsudekum merged commit d6dfe12 into master Sep 28, 2017
@bsudekum bsudekum deleted the depart branch September 28, 2017 00:26
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