libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/route/RouteViewModel.java
public void fetchRouteFromOffRouteEvent(OffRouteEvent event) {
    if (OffRouteEvent.isValid(event)) {
      Double bearing = null;
      if (rawLocation != null) {
        bearing = rawLocation.hasBearing() ? Float.valueOf(rawLocation.getBearing()).doubleValue() : null;
      }
      Point origin = event.getNewOrigin();
      RouteProgress progress = event.getRouteProgress();
      NavigationRoute.Builder builder = buildRouteRequestFromCurrentLocation(origin, bearing, progress);
      if (builder != null) {
        addNavigationViewOptions(builder);
        builder.build().getRoute(this);
      }
    }
  }
/**
   * Requests a new {@link DirectionsRoute}.
   * <p>
   * Will use {@link Location} bearing if we have a rawLocation with bearing.
   * <p>
   * Called when an off-route event is fired and a new {@link DirectionsRoute}
   * is needed to continue navigating.
   *
   * @param event found from off-route event
   */
Requests a new  DirectionsRoute.

Will use  Location bearing if we have a rawLocation with bearing.

Called when an off-route event is fired and a new  DirectionsRoute
is needed to continue navigating.

@param event found from off-route event
Requests a new DirectionsRoute . Will use Location bearing if we have a rawLocation with bearing . Called when an off - route event is fired and a new DirectionsRoute is needed to continue navigating . @param event found from off - route event
public void fetchRouteFromOffRouteEvent(OffRouteEvent event) {
    if (OffRouteEvent.isValid(event)) {
      Double bearing = null;
      if (rawLocation != null) {
        bearing = rawLocation.hasBearing() ? Float.valueOf(rawLocation.getBearing()).doubleValue() : null;
      }
      Point origin = event.getNewOrigin();
      RouteProgress progress = event.getRouteProgress();
      NavigationRoute.Builder builder = buildRouteRequestFromCurrentLocation(origin, bearing, progress);
      if (builder != null) {
        addNavigationViewOptions(builder);
        builder.build().getRoute(this);
      }
    }
  }
public void fetchRouteFromOffRouteEvent ( OffRouteEvent event ) { if ( OffRouteEvent . isValid ( event ) ) { Double bearing = null ; if ( rawLocation != null ) { bearing = rawLocation . hasBearing ( ) ? Float . valueOf ( rawLocation . getBearing ( ) ) . doubleValue ( ) : null ; } Point origin = event . getNewOrigin ( ) ; RouteProgress progress = event . getRouteProgress ( ) ; NavigationRoute . Builder builder = buildRouteRequestFromCurrentLocation ( origin , bearing , progress ) ; if ( builder != null ) { addNavigationViewOptions ( builder ) ; builder . build ( ) . getRoute ( this ) ; } } }
Requests a new {@link DirectionsRoute}.
Requests a new { @link DirectionsRoute } .