diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java index ec4b903a744..6699bedfacb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java @@ -13,8 +13,6 @@ import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.widgets.MyLocationView; -import java.util.concurrent.TimeUnit; - import timber.log.Timber; import static com.mapbox.mapboxsdk.maps.MapView.REGION_DID_CHANGE_ANIMATED; @@ -108,7 +106,7 @@ final void easeCamera(MapboxMap mapboxMap, CameraUpdate update, int durationMs, mapView.addOnMapChangedListener(this); } - mapView.easeTo(cameraPosition.bearing, cameraPosition.target, getDurationNano(durationMs), cameraPosition.tilt, + mapView.easeTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt, cameraPosition.zoom, easingInterpolator); } } @@ -126,7 +124,7 @@ final void animateCamera(MapboxMap mapboxMap, CameraUpdate update, int durationM mapView.addOnMapChangedListener(this); } - mapView.flyTo(cameraPosition.bearing, cameraPosition.target, getDurationNano(durationMs), cameraPosition.tilt, + mapView.flyTo(cameraPosition.bearing, cameraPosition.target, durationMs, cameraPosition.tilt, cameraPosition.zoom); } } @@ -161,10 +159,6 @@ void setOnCameraChangeListener(@Nullable MapboxMap.OnCameraChangeListener listen this.onCameraChangeListener = listener; } - private long getDurationNano(long durationMs) { - return durationMs > 0 ? TimeUnit.NANOSECONDS.convert(durationMs, TimeUnit.MILLISECONDS) : 0; - } - // // non Camera API // diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index f1345c01f9d..dd4cadbcfb1 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -397,7 +397,7 @@ void NativeMapView::easeTo(jni::JNIEnv&, jni::jdouble angle, jni::jdouble latitu } mbgl::AnimationOptions animationOptions; - animationOptions.duration.emplace(mbgl::Duration(duration)); + animationOptions.duration.emplace(mbgl::Milliseconds(duration)); if (!easing) { // add a linear interpolator instead of easing animationOptions.easing.emplace(mbgl::util::UnitBezier { 0, 0, 1, 1 }); @@ -421,7 +421,7 @@ void NativeMapView::flyTo(jni::JNIEnv&, jni::jdouble angle, jni::jdouble latitud } mbgl::AnimationOptions animationOptions; - animationOptions.duration.emplace(mbgl::Duration(duration)); + animationOptions.duration.emplace(mbgl::Milliseconds(duration)); map->flyTo(cameraOptions, animationOptions); }