From c6519194f65639f3c7cc12b7841148e4e09f793e Mon Sep 17 00:00:00 2001 From: tobrun Date: Fri, 12 Apr 2019 15:04:14 +0200 Subject: [PATCH] [android] - allow snapshot generation without overlain view content --- .../com/mapbox/mapboxsdk/maps/NativeMapView.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java index c2aed13dddd..f7086ac712b 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java @@ -1047,10 +1047,15 @@ protected void onSnapshotReady(@Nullable Bitmap mapContent) { if (checkState("OnSnapshotReady")) { return; } - - Bitmap viewContent = viewCallback.getViewContent(); - if (snapshotReadyCallback != null && mapContent != null && viewContent != null) { - snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent)); + if (snapshotReadyCallback != null && mapContent != null) { + if (viewCallback == null) { + snapshotReadyCallback.onSnapshotReady(mapContent); + } else { + Bitmap viewContent = viewCallback.getViewContent(); + if (viewContent != null) { + snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent)); + } + } } }