I'm currently working on a simple turn-by-turn Navigation App with the MapBox SDK. As default when the user goes off route and the route is recalculated the SDK does not consider U-turns to get to the old route. I wonder if there is a way to force U-turns anytime the user goes off route. It is necessary for my application to always use u-turns if a rerouting takes place. Maybe the OffRouteObserve could be a possible solution but I didn't have a clue on how to use this. I would be grateful for any help.
mapboxNavigation.requestRoutes(
RouteOptions.builder()
.applyDefaultNavigationOptions(DirectionsCriteria.PROFILE_WALKING)//TODO DirectionsCriteria.PROFILE_CYCLING
.coordinatesList(listOf(originPoint,
testPoint1, testPoint2, testPoint3, testPoint4,
destination))
.waypointIndicesList(listOf(0, 5)) //TODO
.build(),
That is my RouteOptions.builder()
to calculate the initial route. I have tried the .bearings
option, the .continueStraight
and the .enableRefresh
method but none of these options worked.