From 59810cfacda5c6c6b401b16fedb041abbdbc31db Mon Sep 17 00:00:00 2001 From: James Rich Date: Mon, 13 Apr 2026 14:01:15 -0500 Subject: [PATCH] =?UTF-8?q?fix(map):=20audit=20best=20practices=20?= =?UTF-8?q?=E2=80=94=20OnlyLogo=20ornaments,=20always-visible=20location?= =?UTF-8?q?=20puck,=20rounded=20line=20caps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - OrnamentOptions.AllEnabled → OnlyLogo since custom MapControlsOverlay already provides compass and controls (avoids duplicate native ornaments) - Location puck now visible whenever location is available, not only when tracking is enabled (standard map UX — blue dot always shows position) - Add LineCap.Round + LineJoin.Round to all route and track LineLayer instances for smooth corners instead of jagged defaults --- .../kotlin/org/meshtastic/feature/map/MapScreen.kt | 2 +- .../meshtastic/feature/map/component/MaplibreMapContent.kt | 2 +- .../org/meshtastic/feature/map/component/NodeTrackLayers.kt | 4 ++++ .../meshtastic/feature/map/component/TracerouteLayers.kt | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/MapScreen.kt b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/MapScreen.kt index daedbfe0d..043c4ec50 100644 --- a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/MapScreen.kt +++ b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/MapScreen.kt @@ -161,7 +161,7 @@ fun MapScreen( longPressPosition = null showWaypointDialog = true }, - locationState = if (isLocationTrackingEnabled && locationAvailable) locationState else null, + locationState = if (locationAvailable) locationState else null, ) // Auto-pan camera when location tracking is enabled diff --git a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MaplibreMapContent.kt b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MaplibreMapContent.kt index 80032ed0c..7299b387c 100644 --- a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MaplibreMapContent.kt +++ b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MaplibreMapContent.kt @@ -118,7 +118,7 @@ fun MaplibreMapContent( modifier = modifier, baseStyle = baseStyle, cameraState = cameraState, - options = MapOptions(gestureOptions = gestureOptions, ornamentOptions = OrnamentOptions.AllEnabled), + options = MapOptions(gestureOptions = gestureOptions, ornamentOptions = OrnamentOptions.OnlyLogo), onMapLongClick = { position, _ -> onMapLongClick(position) ClickResult.Consume diff --git a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/NodeTrackLayers.kt b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/NodeTrackLayers.kt index 748e2bcdc..fe38673c3 100644 --- a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/NodeTrackLayers.kt +++ b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/NodeTrackLayers.kt @@ -25,6 +25,8 @@ import org.maplibre.compose.expressions.dsl.asString import org.maplibre.compose.expressions.dsl.const import org.maplibre.compose.expressions.dsl.eq import org.maplibre.compose.expressions.dsl.feature +import org.maplibre.compose.expressions.value.LineCap +import org.maplibre.compose.expressions.value.LineJoin import org.maplibre.compose.layers.CircleLayer import org.maplibre.compose.layers.LineLayer import org.maplibre.compose.sources.GeoJsonData @@ -67,6 +69,8 @@ internal fun NodeTrackLayers( width = const(3.dp), color = const(TrackColor), // Blue opacity = const(TRACK_OPACITY), + cap = const(LineCap.Round), + join = const(LineJoin.Round), ) // Position marker points diff --git a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/TracerouteLayers.kt b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/TracerouteLayers.kt index 11a17b912..58895e624 100644 --- a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/TracerouteLayers.kt +++ b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/TracerouteLayers.kt @@ -29,6 +29,8 @@ import org.maplibre.compose.expressions.dsl.asString import org.maplibre.compose.expressions.dsl.const import org.maplibre.compose.expressions.dsl.feature import org.maplibre.compose.expressions.dsl.offset +import org.maplibre.compose.expressions.value.LineCap +import org.maplibre.compose.expressions.value.LineJoin import org.maplibre.compose.layers.CircleLayer import org.maplibre.compose.layers.LineLayer import org.maplibre.compose.layers.SymbolLayer @@ -80,6 +82,8 @@ internal fun TracerouteLayers( width = const(3.dp), color = const(ForwardRouteColor), // Green opacity = const(ROUTE_OPACITY), + cap = const(LineCap.Round), + join = const(LineJoin.Round), ) } @@ -93,6 +97,8 @@ internal fun TracerouteLayers( color = const(ReturnRouteColor), // Red opacity = const(ROUTE_OPACITY), dasharray = const(listOf(2f, 1f)), + cap = const(LineCap.Round), + join = const(LineJoin.Round), ) }