From 125c38c4d21ffd4c1ca9e8cdc04d793240b69112 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:44:14 +0000 Subject: [PATCH 1/2] Update maplibre.compose to v0.18.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f443a8a303..d0cba77805 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -45,7 +45,7 @@ appyx = "1.7.1" sqldelight = "2.4.0" wysiwyg = "2.42.1" telephoto = "0.19.0" -maplibre-compose = "0.17.0" +maplibre-compose = "0.18.0" # Dependency analysis dependencyAnalysis = "3.19.2" From 604c5438c6ee294dcdd004cef372651a06e54888 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 6 Oct 2026 15:45:40 +0200 Subject: [PATCH 2/2] Adapt location feature to maplibre.compose 0.18.0 API --- .../impl/common/ui/MapBottomSheetScaffold.kt | 2 +- .../impl/common/ui/UserLocationPuck.kt | 33 ++++++++----------- .../UserLocationTrackingEffect.kt | 3 +- .../location/impl/show/ShowLocationView.kt | 3 +- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/MapBottomSheetScaffold.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/MapBottomSheetScaffold.kt index 68333251a5..d90888da5c 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/MapBottomSheetScaffold.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/MapBottomSheetScaffold.kt @@ -140,7 +140,7 @@ fun MapBottomSheetScaffold( isReady && mapState != null -> { MaplibreMap( state = mapState, - cameraPadding = sheetPadding, + viewportInsets = sheetPadding, renderOptions = renderOptions, interactions = interactions, uiOptions = uiOptions, diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/UserLocationPuck.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/UserLocationPuck.kt index aecb6f12b8..bfa94f8c61 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/UserLocationPuck.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/ui/UserLocationPuck.kt @@ -8,33 +8,28 @@ package io.element.android.features.location.impl.common.ui import androidx.compose.runtime.Composable -import androidx.compose.ui.unit.dp import io.element.android.compound.theme.ElementTheme +import org.maplibre.compose.layers.LocationIndicatorDefaults +import org.maplibre.compose.layers.LocationIndicatorLayer import org.maplibre.compose.location.LocationMeasurement -import org.maplibre.compose.location.LocationPuck -import org.maplibre.compose.location.LocationPuckColors -import org.maplibre.compose.location.LocationPuckSizes -import org.maplibre.spatialk.units.Length @Composable fun UserLocationPuck( location: LocationMeasurement?, ) { - LocationPuck( - idPrefix = "user-location", - location = location, - // Hide the accuracy circle. - accuracyThreshold = Length.PositiveInfinity, - // Hide the bearing (and bearing accuracy) indicator. + LocationIndicatorLayer( + id = "user-location", + location = location?.position, + // Hide the accuracy circle and the bearing accuracy sector: leaving `accuracyRadius` + // and `bearingAccuracy` null is what hides them. + accuracyRadius = null, + bearingAccuracy = null, + // Hide the bearing indicator. bearing = null, - sizes = LocationPuckSizes( - dotRadius = 8.dp, - dotStrokeWidth = 2.dp, + bearingImage = null, + topImage = LocationIndicatorDefaults.topImage( + color = ElementTheme.colors.iconAccentPrimary, + borderColor = ElementTheme.colors.bgCanvasDefault, ), - colors = LocationPuckColors( - dotFillColorCurrentLocation = ElementTheme.colors.iconAccentPrimary, - dotFillColorOldLocation = ElementTheme.colors.iconAccentTertiary, - dotStrokeColor = ElementTheme.colors.bgCanvasDefault, - ) ) } diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/userlocation/UserLocationTrackingEffect.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/userlocation/UserLocationTrackingEffect.kt index c5760c3a95..08cff42c4a 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/userlocation/UserLocationTrackingEffect.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/common/userlocation/UserLocationTrackingEffect.kt @@ -17,6 +17,7 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow import io.element.android.features.location.impl.common.MapDefaults import kotlinx.coroutines.flow.distinctUntilChanged +import org.maplibre.compose.camera.CameraAnimation import org.maplibre.compose.location.LocationMeasurement import org.maplibre.compose.map.MapState import kotlin.math.abs @@ -77,7 +78,7 @@ internal fun UserLocationTrackingEffect( zoom = mapState.cameraPosition.zoom.coerceAtLeast(MapDefaults.DEFAULT_ZOOM) ) if (hasPositioned) { - mapState.animateCameraPosition(position) + mapState.animateCamera(position.toCameraUpdate(), CameraAnimation.Fly()) } else { mapState.setCameraPosition(position) hasPositioned = true diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt index 8e45996d09..8a797ad1a6 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt @@ -54,6 +54,7 @@ import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.launch +import org.maplibre.compose.camera.CameraAnimation import org.maplibre.compose.camera.CameraMoveReason import org.maplibre.compose.camera.CameraPosition import org.maplibre.compose.map.MapState @@ -149,7 +150,7 @@ private fun ShowLocationViewContent( zoom = mapState.cameraPosition.zoom.coerceAtLeast(MapDefaults.DEFAULT_ZOOM), ) coroutineScope.launch { - mapState.animateCameraPosition(position = position) + mapState.animateCamera(update = position.toCameraUpdate(), animation = CameraAnimation.Fly()) } }, modifier = modifier,