Merge branch 'main' into release/2.7.0

This commit is contained in:
James Rich 2025-09-04 08:30:42 -05:00 committed by GitHub
commit 65e1706f45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 0 deletions

View file

@ -642,6 +642,21 @@ fun MapView(
isLocationTrackingEnabled = !isLocationTrackingEnabled
}
},
onOrientNorth = {
coroutineScope.launch {
try {
val currentPosition = cameraPositionState.position
val newCameraPosition =
CameraPosition.Builder(currentPosition)
.bearing(0f) // Orient to north
.build()
cameraPositionState.animate(CameraUpdateFactory.newCameraPosition(newCameraPosition))
debug("Oriented map to north")
} catch (e: IllegalStateException) {
debug("Error orienting map to north: ${e.message}")
}
}
},
)
}
if (showLayersBottomSheet) {

View file

@ -20,6 +20,7 @@ package com.geeksville.mesh.ui.map.components
import androidx.compose.foundation.layout.Box
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.LocationDisabled
import androidx.compose.material.icons.outlined.Explore
import androidx.compose.material.icons.outlined.Layers
import androidx.compose.material.icons.outlined.Map
import androidx.compose.material.icons.outlined.MyLocation
@ -52,6 +53,7 @@ fun MapControlsOverlay(
hasLocationPermission: Boolean = false,
isLocationTrackingEnabled: Boolean = false,
onToggleLocationTracking: () -> Unit = {},
onOrientNorth: () -> Unit = {},
) {
VerticalFloatingToolbar(
modifier = modifier,
@ -95,6 +97,8 @@ fun MapControlsOverlay(
onClick = onManageLayersClicked,
)
CompassButton(onOrientNorth = onOrientNorth)
// Location tracking button
if (hasLocationPermission) {
MapButton(
@ -111,3 +115,12 @@ fun MapControlsOverlay(
},
)
}
@Composable
private fun CompassButton(onOrientNorth: () -> Unit) {
MapButton(
icon = Icons.Outlined.Explore,
contentDescription = stringResource(id = R.string.orient_north),
onClick = onOrientNorth,
)
}

View file

@ -193,6 +193,12 @@
"title": "the original ZPS module from https://github.com/a-f-G-U-C/Meshtastic-ZPS",
"page_url": "https://github.com/meshtastic/firmware/pull/7658",
"zip_url": "https://github.com/meshtastic/firmware/actions/runs/17074730483"
},
{
"id": "7583",
"title": "chore(deps): update meshtastic/web to v2.6.6",
"page_url": "https://github.com/meshtastic/firmware/pull/7583",
"zip_url": "https://github.com/meshtastic/firmware/actions/runs/17070663764"
}
]
}

View file

@ -331,6 +331,7 @@
<string name="udp_config">UDP Config</string>
<string name="map_node_popup_details"><![CDATA[%1$s<br>Last heard: %2$s<br>Last position: %3$s<br>Battery: %4$s]]></string>
<string name="toggle_my_position">Toggle my position</string>
<string name="orient_north">Orient north</string>
<string name="user">User</string>
<string name="channels">Channels</string>
<string name="device">Device</string>