From 8f8d532e036155cf7bb77abf14acbbaa1525e15c Mon Sep 17 00:00:00 2001 From: Tobrun Date: Tue, 31 Oct 2017 13:18:41 -0700 Subject: [android] - rework ease interactions to take in account possitve duration requirement --- .../src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 14 +++++--------- .../com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java | 7 +++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index f25e05429e..83b4dc4e84 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -149,12 +149,8 @@ public final class MapboxMap { trackingSettings.onRestoreInstanceState(savedInstanceState); if (cameraPosition != null) { - easeCamera(CameraUpdateFactory.newCameraPosition( - new CameraPosition.Builder(cameraPosition).build()), - 0, - false, - null, - !trackingSettings.isLocationTrackingDisabled() + moveCamera(CameraUpdateFactory.newCameraPosition( + new CameraPosition.Builder(cameraPosition).build()) ); } @@ -1677,9 +1673,9 @@ public final class MapboxMap { /** * Get a camera position that fits a provided shape with a given bearing and padding. * - * @param geometry the geometry to constrain the map with - * @param bearing the bearing at which to compute the geometry's bounds - * @param padding the padding to apply to the bounds + * @param geometry the geometry to constrain the map with + * @param bearing the bearing at which to compute the geometry's bounds + * @param padding the padding to apply to the bounds * @return the camera position that fits the bounds and padding */ public CameraPosition getCameraForGeometry(Geometry geometry, double bearing, int[] padding) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index 983ba2550f..ac91746a2a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -49,6 +49,7 @@ import timber.log.Timber; *

* Use {@link MyLocationViewSettings} to manipulate the state of this view. *

+ * * @deprecated use location layer plugin from * https://github.com/mapbox/mapbox-plugins-android/tree/master/plugins/locationlayer instead. */ @@ -639,8 +640,7 @@ public class MyLocationView extends View { if (location != null) { if (myLocationTrackingMode == MyLocationTracking.TRACKING_FOLLOW) { // center map directly - mapboxMap.easeCamera(CameraUpdateFactory.newLatLng(new LatLng(location)), 0, false /*linear interpolator*/, - null, true); + mapboxMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(location))); } else { // do not use interpolated location from tracking mode latLng = null; @@ -1022,8 +1022,7 @@ public class MyLocationView extends View { mapboxMap.easeCamera(CameraUpdateFactory.newCameraPosition(builder.build()), animationDuration, false, null, true); } else { - mapboxMap.easeCamera(CameraUpdateFactory.newCameraPosition(builder.build()), 0, false, null, - true); + mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(builder.build())); } } -- cgit v1.2.1