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 e88b228a23c..bcf4a70daea 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 @@ -1161,7 +1161,9 @@ protected void onSnapshotReady(@Nullable Bitmap mapContent) { } else { Bitmap viewContent = viewCallback.getViewContent(); if (viewContent != null) { - snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent)); + snapshotReadyCallback.onSnapshotReady( + BitmapUtils.mergeBitmaps(mapContent, viewContent) + ); } } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java index b8403d3f8bc..034388d13a1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java @@ -47,16 +47,31 @@ public static Bitmap createBitmapFromView(@NonNull View view) { } /** - * Create a bitmap from a background and a foreground bitmap + * Create a bitmap from a background and a foreground bitmap. The foreground bitmap + * will be shifted 10px to the right and 10px to the bottom relative to the background. * * @param background The bitmap placed in the background * @param foreground The bitmap placed in the foreground * @return the merged bitmap + * @deprecated {@link #mergeBitmaps(Bitmap, Bitmap)} should be used instead, as it does not + * shift the input by 10px to the right and bottom. */ + @Deprecated public static Bitmap mergeBitmap(@NonNull Bitmap background, @NonNull Bitmap foreground) { return mergeBitmap(background, foreground, 10f, 10f); } + /** + * Create a bitmap from a background and a foreground bitmap. + * + * @param background The bitmap placed in the background + * @param foreground The bitmap placed in the foreground + * @return the merged bitmap + */ + public static Bitmap mergeBitmaps(@NonNull Bitmap background, @NonNull Bitmap foreground) { + return mergeBitmap(background, foreground, 0f, 0f); + } + /** * Create a bitmap from a background and a foreground bitmap *