diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2018-10-29 15:43:46 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-11-05 18:25:49 +0100 |
commit | 1c733568b0e14f0d2bb1b81fdf5527b300d039a4 (patch) | |
tree | c429aae4eeab7618fd985d192ed8f8e53653399e /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | |
parent | 68fd3a28225cccf9f1564af9dec0151f13cc8700 (diff) | |
download | qtlocation-mapboxgl-1c733568b0e14f0d2bb1b81fdf5527b300d039a4.tar.gz |
[android] - expose moveBy, replace CameraUpdateFactory hook to moveBy for scrolling api
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 23 |
1 files changed, 23 insertions, 0 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 7b9484d309..7172a6a52a 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 @@ -866,6 +866,29 @@ public final class MapboxMap { } } + /** + * Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and y + * directions. + * + * @param x Amount of pixels to scroll to in x direction + * @param y Amount of pixels to scroll to in y direction + */ + public void scrollBy(float x, float y) { + nativeMapView.moveBy(x, y); + } + + /** + * Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and y + * directions. + * + * @param x Amount of pixels to scroll to in x direction + * @param y Amount of pixels to scroll to in y direction + * @param duration Amount of time the scrolling should take + */ + public void scrollBy(float x, float y, long duration) { + nativeMapView.moveBy(x, y, duration); + } + // // Reset North // |