Skip to content

Conversation

@davidyou3
Copy link
Contributor

  • Replace RouteControllerMinimumDistanceForMediumAlert and RouteControllerMinimumDistanceForHighAlert with
    RouteControllerMinimumDistanceForHighAlertDriving, RouteControllerMinimumDistanceForHighAlertCycling, RouteControllerMinimumDistanceForHighAlertWalking
    RouteControllerMinimumDistanceForMediumAlertDriving, RouteControllerMinimumDistanceForMediumAlertCycling, RouteControllerMinimumDistanceForMediumAlertWalking
    to allow for different minimum distance per transportation method.

  • Add RouteControllerMinimumDistanceForMediumAlert(identifier:) and RouteControllerMinimumDistanceForHighAlert(identifier:)
    to choose which minimum distance is approriate for which MBDirectionsProfileIdentifier type.

  • Modifiy MapboxNavigation/RouteController and MapboxNavigationUI/RouteVoiceController to use
    new minimum distance values.

@bsudekum @1ec5 @boundsj

- Replace RouteControllerMinimumDistanceForMediumAlert and RouteControllerMinimumDistanceForHighAlert with
RouteControllerMinimumDistanceForHighAlertDriving, RouteControllerMinimumDistanceForHighAlertCycling, RouteControllerMinimumDistanceForHighAlertWalking
RouteControllerMinimumDistanceForMediumAlertDriving, RouteControllerMinimumDistanceForMediumAlertCycling, RouteControllerMinimumDistanceForMediumAlertWalking
to allow for different minimum distance per transportation method.

- Add RouteControllerMinimumDistanceForMediumAlert(identifier:) and RouteControllerMinimumDistanceForHighAlert(identifier:)
to choose which minimum distance is approriate for which MBDirectionsProfileIdentifier type.

- Modifiy MapboxNavigation/RouteController and MapboxNavigationUI/RouteVoiceController to use
new minimum distance values.
public var RouteControllerMinimumDistanceForMediumAlertWalking: CLLocationDistance = 100

public func RouteControllerMinimumDistanceForMediumAlert(identifier: MBDirectionsProfileIdentifier) -> CLLocationDistance {
if identifier == .automobile || identifier == .automobileAvoidingTraffic {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a switch statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I thought because MBDirectionsProfileIdentifier is a struct type, switching on it may be a bit weird. But I think it's possible to switch on this. I will submit a new commit.

- Use switch() instead of if else when evaulating RouteControllerMinimumDistanceForMediumAlert
and RouteControllerMinimumDistanceForHighAlert.
@davidyou3
Copy link
Contributor Author

@1ec5 Please review new commit 4f16614

@bsudekum
Copy link
Contributor

👍 looks good

@bsudekum bsudekum merged commit c0fef30 into master Mar 21, 2017
@bsudekum bsudekum deleted the custom-minimum-distances branch March 21, 2017 23:48
This was referenced Mar 24, 2017
wishtrip-dev pushed a commit to wishtrip-dev/mapbox-navigation-ios that referenced this pull request Feb 28, 2018
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