From 0f4633a0c5061a965c08211fc468c1aad4b7ab0f Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Fri, 6 Nov 2026 10:23:15 -0800 Subject: [PATCH] Add a GroundImage(bounds, imageUrl) overload Same as the Drawable overload, with the image given as a URL that core loads (GroundImageState(bounds, imageUrl)). --- api/android-sdk-compose.api | 1 + .../groundimage/GroundImageComponent.kt | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/api/android-sdk-compose.api b/api/android-sdk-compose.api index bac0a49..d5e97f2 100644 --- a/api/android-sdk-compose.api +++ b/api/android-sdk-compose.api @@ -23,6 +23,7 @@ public final class com.mapconductor.compose.circle.LocalCircleCollectorKt { public final class com.mapconductor.compose.groundimage.GroundImageComponentKt { public static final void GroundImage(com.mapconductor.compose.MapViewScope, com.mapconductor.core.groundimage.GroundImageState, androidx.compose.runtime.Composer, int); public static final void GroundImage(com.mapconductor.compose.MapViewScope, com.mapconductor.core.features.GeoRectBounds, android.graphics.drawable.Drawable, float, int, java.lang.String, java.io.Serializable, kotlin.jvm.functions.Function1, androidx.compose.runtime.Composer, int, int); + public static final void GroundImage(com.mapconductor.compose.MapViewScope, com.mapconductor.core.features.GeoRectBounds, java.lang.String, float, int, java.lang.String, java.io.Serializable, kotlin.jvm.functions.Function1, androidx.compose.runtime.Composer, int, int); } public final class com.mapconductor.compose.groundimage.LocalGroundImageCollectorKt { public static final androidx.compose.runtime.ProvidableCompositionLocal> getLocalGroundImageCollector(); diff --git a/src/main/java/com/mapconductor/compose/groundimage/GroundImageComponent.kt b/src/main/java/com/mapconductor/compose/groundimage/GroundImageComponent.kt index e2a849b..1760091 100644 --- a/src/main/java/com/mapconductor/compose/groundimage/GroundImageComponent.kt +++ b/src/main/java/com/mapconductor/compose/groundimage/GroundImageComponent.kt @@ -47,3 +47,30 @@ fun MapViewScope.GroundImage( ) GroundImage(state) } + +/** + * [imageUrl](http / https / file / data)の画像を貼る。SDK が読み、読み終えるまでは透明。 + * http(s) にはアプリの `android.permission.INTERNET` が要る。 + */ +@Composable +fun MapViewScope.GroundImage( + bounds: GeoRectBounds, + imageUrl: String, + opacity: Float = 0.5f, + tileSize: Int = GroundImageTileProvider.DEFAULT_TILE_SIZE, + id: String? = null, + extra: Serializable? = null, + onClick: OnGroundImageEventHandler? = null, +) { + val state = + GroundImageState( + bounds = bounds, + imageUrl = imageUrl, + opacity = opacity, + tileSize = tileSize, + id = id, + extra = extra, + onClick = onClick, + ) + GroundImage(state) +}