libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/camera/NavigationCamera.java
private void animateCameraFromRoute(RouteInformation routeInformation) {

    Camera cameraEngine = navigation.getCameraEngine();

    Point targetPoint = cameraEngine.target(routeInformation);
    LatLng targetLatLng = new LatLng(targetPoint.latitude(), targetPoint.longitude());
    double bearing = cameraEngine.bearing(routeInformation);
    double zoom = cameraEngine.zoom(routeInformation);

    CameraPosition position = new CameraPosition.Builder()
      .target(targetLatLng)
      .bearing(bearing)
      .zoom(zoom)
      .build();

    updateMapCameraPosition(position, new MapboxMap.CancelableCallback() {
      @Override
      public void onCancel() {
        navigation.addProgressChangeListener(NavigationCamera.this);
      }

      @Override
      public void onFinish() {
        navigation.addProgressChangeListener(NavigationCamera.this);
      }
    });
  }
/**
   * Creates an initial animation with the given {@link RouteInformation#route()}.
   * <p>
   * This is the first animation that fires prior to receiving progress updates.
   * <p>
   * If a user interacts with the {@link MapboxMap} while the animation is in progress,
   * the animation will be cancelled.  So it's important to add the {@link ProgressChangeListener}
   * in both onCancel() and onFinish() scenarios.
   *
   * @param routeInformation with route data
   */
Creates an initial animation with the given  RouteInformation#route().

This is the first animation that fires prior to receiving progress updates.

If a user interacts with the  MapboxMap while the animation is in progress,
the animation will be cancelled.  So it's important to add the  ProgressChangeListener
in both onCancel() and onFinish() scenarios.

@param routeInformation with route data
Creates an initial animation with the given RouteInformation#route () . This is the first animation that fires prior to receiving progress updates . If a user interacts with the MapboxMap while the animation is in progress the animation will be cancelled . So it ' s important to add the ProgressChangeListener in both onCancel () and onFinish () scenarios . @param routeInformation with route data
private void animateCameraFromRoute(RouteInformation routeInformation) {
    Camera cameraEngine = navigation.getCameraEngine();
    Point targetPoint = cameraEngine.target(routeInformation);
    LatLng targetLatLng = new LatLng(targetPoint.latitude(), targetPoint.longitude());
    double bearing = cameraEngine.bearing(routeInformation);
    double zoom = cameraEngine.zoom(routeInformation);
    CameraPosition position = new CameraPosition.Builder()
      .target(targetLatLng)
      .bearing(bearing)
      .zoom(zoom)
      .build();
    updateMapCameraPosition(position, new MapboxMap.CancelableCallback() {
      @Override
      public void onCancel() {
        navigation.addProgressChangeListener(NavigationCamera.this);
      }
      @Override
      public void onFinish() {
        navigation.addProgressChangeListener(NavigationCamera.this);
      }
    });
  }
private void animateCameraFromRoute ( RouteInformation routeInformation ) { Camera cameraEngine = navigation . getCameraEngine ( ) ; Point targetPoint = cameraEngine . target ( routeInformation ) ; LatLng targetLatLng = new LatLng ( targetPoint . latitude ( ) , targetPoint . longitude ( ) ) ; double bearing = cameraEngine . bearing ( routeInformation ) ; double zoom = cameraEngine . zoom ( routeInformation ) ; CameraPosition position = new CameraPosition . Builder ( ) . target ( targetLatLng ) . bearing ( bearing ) . zoom ( zoom ) . build ( ) ; updateMapCameraPosition ( position , new MapboxMap . CancelableCallback ( ) { @ Override public void onCancel ( ) { navigation . addProgressChangeListener ( NavigationCamera . this ) ; } @ Override public void onFinish ( ) { navigation . addProgressChangeListener ( NavigationCamera . this ) ; } } ) ; }
Creates an initial animation with the given {@link RouteInformation#route()}.
Creates an initial animation with the given { @link RouteInformation#route () } .