mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-14 02:49:56 -04:00
fix(map): audit best practices — OnlyLogo ornaments, always-visible location puck, rounded line caps
- 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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user