diff --git a/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerCamera.java b/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerCamera.java index 2aad8dfc8..1dd3f29f6 100644 --- a/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerCamera.java +++ b/plugin-locationlayer/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerCamera.java @@ -40,6 +40,7 @@ final class LocationLayerCamera implements PluginAnimator.OnCameraAnimationsValu moveGestureDetector = mapboxMap.getGesturesManager().getMoveGestureDetector(); mapboxMap.addOnMoveListener(onMoveListener); mapboxMap.addOnRotateListener(onRotateListener); + mapboxMap.addOnFlingListener(onFlingListener); this.internalCameraTrackingChangedListener = internalCameraTrackingChangedListener; this.onCameraMoveInvalidateListener = onCameraMoveInvalidateListener; @@ -211,6 +212,13 @@ public void onRotateEnd(RotateGestureDetector detector) { } }; + private MapboxMap.OnFlingListener onFlingListener = new MapboxMap.OnFlingListener() { + @Override + public void onFling() { + setCameraMode(CameraMode.NONE); + } + }; + private class PluginsGesturesManager extends AndroidGesturesManager { public PluginsGesturesManager(Context context) {