[android] #4516 - cleanup snapshot PR

This commit is contained in:
Tobrun
2016-04-01 09:19:43 +02:00
parent 862305d935
commit aef1f8124c
5 changed files with 75 additions and 53 deletions

View File

@@ -1469,11 +1469,22 @@ public class MapboxMap {
mMapView.update();
}
/**
* Takes a snapshot of the map.
*
* @param callback Callback method invoked when the snapshot is taken.
* @param bitmap A pre-allocated bitmap.
*/
@UiThread
public void snapshot(@NonNull SnapshotReadyCallback callback, @Nullable final Bitmap bitmap) {
mMapView.snapshot(callback, bitmap);
}
/**
* Takes a snapshot of the map.
*
* @param callback Callback method invoked when the snapshot is taken.
*/
@UiThread
public void snapshot(@NonNull SnapshotReadyCallback callback) {
mMapView.snapshot(callback, null);
@@ -1700,7 +1711,13 @@ public class MapboxMap {
void onFinish();
}
/**
* Interface definition for a callback to be invoked when the snapshot has been taken.
*/
public interface SnapshotReadyCallback {
/**
* Invoked when the snapshot has been taken.
**/
void onSnapshotReady(Bitmap snapshot);
}