libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/NavigationViewModel.java
@Override
  public void userOffRoute(Location location) {
    if (hasNetworkConnection()) {
      Point newOrigin = Point.fromLngLat(location.getLongitude(), location.getLatitude());
      this.offRouteEvent.setValue(new OffRouteEvent(newOrigin, routeProgress));
      isOffRoute.setValue(true);
    }
  }
/**
   * Listener used to update when a user has gone off-route.
   * <p>
   * This is being used as a cue for a re-route UX / to fetch a new route to
   * keep the user on course.
   * <p>
   * Added to {@link com.mapbox.services.android.navigation.v5.navigation.MapboxNavigation}.
   *
   * @param location given to create a new origin
   * @since 0.6.0
   */
Listener used to update when a user has gone off-route.

This is being used as a cue for a re-route UX / to fetch a new route to
keep the user on course.

@param location given to create a new origin
@since 0.6.0
Listener used to update when a user has gone off - route . This is being used as a cue for a re - route UX / to fetch a new route to keep the user on course . @param location given to create a new origin @since 0 . 6 . 0
@Override
  public void userOffRoute(Location location) {
    if (hasNetworkConnection()) {
      Point newOrigin = Point.fromLngLat(location.getLongitude(), location.getLatitude());
      this.offRouteEvent.setValue(new OffRouteEvent(newOrigin, routeProgress));
      isOffRoute.setValue(true);
    }
  }
@ Override public void userOffRoute ( Location location ) { if ( hasNetworkConnection ( ) ) { Point newOrigin = Point . fromLngLat ( location . getLongitude ( ) , location . getLatitude ( ) ) ; this . offRouteEvent . setValue ( new OffRouteEvent ( newOrigin , routeProgress ) ) ; isOffRoute . setValue ( true ) ; } }
Listener used to update when a user has gone off-route.
Listener used to update when a user has gone off - route .