From 75fdf64642021b2f1022d2c1e677c07474c4a52e Mon Sep 17 00:00:00 2001 From: DaVinci9196 Date: Tue, 9 Jul 2024 16:43:32 +0800 Subject: [PATCH] Improved map addGroundOverlay method --- .../hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt b/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt index d12096dacc..22d764fff5 100644 --- a/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt +++ b/play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt @@ -209,6 +209,10 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions) override fun addGroundOverlay(options: GroundOverlayOptions): IGroundOverlayDelegate? { Log.d(TAG, "Method: addGroundOverlay") + if (options.width <= 0 && options.height <= 0 && options.bounds == null) { + Log.w(TAG, "addGroundOverlay options Parameters do not meet requirements") + return null + } val groundOverlay = map?.addGroundOverlay(options.toHms()) ?: return null val groundOverlayImpl = GroundOverlayImpl(groundOverlay) groundOverlays[groundOverlayImpl.id] = groundOverlayImpl