From 5bfbcea1e79f6b5a75c7db5525d5500608d7b7fd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2026 15:24:12 +0000 Subject: [PATCH] chore(deps): update maplibre.compose to v0.19.0 (#7354) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- .../feature/map/maplibre/component/OfflineMapTarget.kt | 4 +++- .../meshtastic/feature/map/maplibre/layers/CustomLayers.kt | 5 +++-- gradle/libs.versions.toml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/component/OfflineMapTarget.kt b/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/component/OfflineMapTarget.kt index be3e16b768..5798688da8 100644 --- a/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/component/OfflineMapTarget.kt +++ b/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/component/OfflineMapTarget.kt @@ -44,6 +44,7 @@ import org.maplibre.compose.map.DefaultMapRuntime import org.maplibre.compose.offline.DownloadProgress import org.maplibre.compose.offline.DownloadStatus import org.maplibre.compose.offline.OfflineManager +import org.maplibre.compose.offline.OfflineManagerState import org.maplibre.compose.offline.OfflinePack import org.maplibre.compose.offline.OfflinePackDefinition import org.maplibre.spatialk.geojson.BoundingBox @@ -90,7 +91,8 @@ internal fun OfflineMapsSection(target: OfflineMapTarget, onShowRegion: (Boundin // the one every map here uses, so its packs are the ones the user sees on the map. val manager = DefaultMapRuntime.instance.offlineManager val scope = rememberCoroutineScope() - val packs by manager.packs.collectAsStateWithLifecycle() + val managerState by manager.state.collectAsStateWithLifecycle() + val packs = (managerState as? OfflineManagerState.Ready)?.packs.orEmpty() // A pack definition now carries the pixel ratio it was downloaded at, so the tiles match this display. val pixelRatio = LocalDensity.current.density diff --git a/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/layers/CustomLayers.kt b/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/layers/CustomLayers.kt index b9afe321b2..ddcb70f4de 100644 --- a/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/layers/CustomLayers.kt +++ b/feature/map-maplibre/src/commonMain/kotlin/org/meshtastic/feature/map/maplibre/layers/CustomLayers.kt @@ -22,7 +22,6 @@ import androidx.compose.runtime.key import androidx.compose.runtime.produceState import androidx.compose.runtime.remember import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp @@ -59,6 +58,7 @@ import org.maplibre.compose.sources.GeoJsonData import org.maplibre.compose.sources.rememberGeoJsonSource import org.maplibre.compose.sources.rememberImageSource import org.maplibre.compose.util.PositionQuad +import org.maplibre.compose.util.PreparedImage import org.maplibre.spatialk.geojson.Position import org.meshtastic.core.common.util.ioDispatcher import org.meshtastic.core.common.util.safeCatching @@ -206,13 +206,14 @@ private fun GroundOverlayLayer(layerId: String, index: Int, overlay: LayerGround // Decoded off the composition thread: an ESRI export's tile is routinely multi-megapixel, and a synchronous // decode in `remember` would hitch the map for every overlay on every first composition. val image by - produceState(initialValue = null, overlay.imagePath) { + produceState(initialValue = null, overlay.imagePath) { value = withContext(ioDispatcher) { safeCatching { mapLayerFileSystem() .read(overlay.imagePath.toLocalPath()) { readByteArray() } .decodeToImageBitmap() + .let(PreparedImage::fromBitmap) } .onFailure { Logger.withTag("CustomLayers").w(it) { "Could not decode a ground overlay image" } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8397c4bbf5..d74f6ae637 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -70,7 +70,7 @@ jetbrains-adaptive = "1.3.0-rc01" # 2.8.0–2.8.1). KML is now read by the app's own xmlutil-based converter and that parser is unused, so # the pairing — and the canary test that guarded it — is gone. The floor stays as a plain minimum. android-maps-utils = "6.0.0" -maplibre-compose = "0.18.0" +maplibre-compose = "0.19.0" maps-compose = "9.0.0" # ML Kit