-
Notifications
You must be signed in to change notification settings - Fork 318
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
DirectionsProfile for reroutes in NavigationView #575
Conversation
@@ -157,6 +159,8 @@ private boolean launchWithRoute(NavigationViewOptions options) { | |||
private void extractRoute(NavigationViewOptions options) { | |||
DirectionsRoute route = options.directionsRoute(); | |||
if (route != null) { | |||
String profile = options.directionsProfile(); | |||
routeProfile = profile != null ? profile : route.routeOptions().profile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several checks are already in place to ensure this is never null including the MAS Directions builder and the server response itself. I've opened mapbox/mapbox-java#683 to change the annotation for this to a NonNull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cammace awesome, thanks for the heads up on this. The options.directionsProfile()
is actually the nullable profile from the NavigationViewOptions
. If it's null, we fall back to the RouteOptions
profile used from the original DirectionsRoute
passed in at initialization of the drop-in UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, it is posible to pass Locale when reroute? seems to be the answer for issue #633
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darkwizzard PR is waiting for review #635
DirectionsRoute
the default for reroutes will be the profile from the route used to launch the UIPosition
coordinates, the default will beDirectionsCriteria.PROFILE_DRIVING_TRAFFIC
cc @ericrwolfe