From fd3587608b950df86809606819e89fbe71139ac3 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Mon, 2 Oct 2017 17:22:56 +0300 Subject: [android] map snapshotter - add mutators --- .../mapboxsdk/snapshotter/MapSnapshotter.java | 34 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'platform/android/MapboxGLAndroidSDK/src/main') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java index 72df86d80d..8118f9ad92 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java @@ -184,7 +184,7 @@ public class MapSnapshotter { * Starts loading and rendering the snapshot. The callbacks will be fired * on the calling thread. * - * @param callback the callback to use when the snapshot is ready + * @param callback the callback to use when the snapshot is ready * @param errorHandler the error handler to use on snapshot errors */ public void start(@NonNull MapboxMap.SnapshotReadyCallback callback, ErrorHandler errorHandler) { @@ -197,12 +197,42 @@ public class MapSnapshotter { nativeStart(); } + /** + * Updates the snapshotter with a new size + * + * @param width the width + * @param height the height + */ + public native void setSize(int width, int height); + + /** + * Updates the snapshotter with a new {@link CameraPosition} + * + * @param cameraPosition the camera position + */ + public native void setCameraPosition(CameraPosition cameraPosition); + + /** + * Updates the snapshotter with a new {@link LatLngBounds} + * + * @param region the region + */ + public native void setRegion(LatLngBounds region); + + /** + * Updates the snapshotter with a new style url + * + * @param styleUrl the style url + */ + public native void setStyleUrl(String styleUrl); + + /** * Must be called in on the thread * the object was created on. */ public void cancel() { - callback = null; + reset(); nativeCancel(); } -- cgit v1.2.1