use of com.mapbox.services.android.navigation.v5.navigation.camera.RouteInformation in project mapbox-navigation-android by mapbox.
the class DynamicCameraTest method onLowDistanceRemaining_engineCreatesCorrectTilt.
@Test
public void onLowDistanceRemaining_engineCreatesCorrectTilt() throws Exception {
RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(null));
double tilt = cameraEngine.tilt(routeInformation);
assertEquals(35d, tilt);
}
use of com.mapbox.services.android.navigation.v5.navigation.camera.RouteInformation in project mapbox-navigation-android by mapbox.
the class DynamicCameraTest method onInformationFromLocationAndProgress_engineCreatesCorrectBearing.
@Test
public void onInformationFromLocationAndProgress_engineCreatesCorrectBearing() throws Exception {
RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(null));
double bearing = cameraEngine.bearing(routeInformation);
assertEquals(100f, bearing, DELTA);
}
use of com.mapbox.services.android.navigation.v5.navigation.camera.RouteInformation in project mapbox-navigation-android by mapbox.
the class DynamicCameraTest method onMediumDistanceRemaining_engineCreatesCorrectTilt.
@Test
public void onMediumDistanceRemaining_engineCreatesCorrectTilt() throws Exception {
RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(200d));
double tilt = cameraEngine.tilt(routeInformation);
assertEquals(40d, tilt);
}
use of com.mapbox.services.android.navigation.v5.navigation.camera.RouteInformation in project mapbox-navigation-android by mapbox.
the class DynamicCameraTest method onInformationFromLocationAndProgress_engineCreatesCorrectTarget.
@Test
public void onInformationFromLocationAndProgress_engineCreatesCorrectTarget() throws Exception {
RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(null));
Point target = cameraEngine.target(routeInformation);
double lng = target.longitude();
assertEquals(-77.0339782574523, lng);
double lat = target.latitude();
assertEquals(38.89993519985637, lat);
}
use of com.mapbox.services.android.navigation.v5.navigation.camera.RouteInformation in project mapbox-navigation-android by mapbox.
the class DynamicCameraTest method onInformationFromRoute_engineCreatesCorrectBearing.
@Test
public void onInformationFromRoute_engineCreatesCorrectBearing() throws Exception {
RouteInformation routeInformation = RouteInformation.create(buildDirectionsRoute(), null, null);
double bearing = cameraEngine.bearing(routeInformation);
assertEquals(-99, Math.round(bearing));
}
Aggregations