fix(map): stop satellite tracking animation in grid mode so it stays centered on the local grid

This commit is contained in:
atsunatsu committed 2026-09-07 22:54:19 +08:00
1 parent c09f718aae
commit 2eb6d6cd5b
1 file changed
+4
@@ -139,6 +139,10 @@ private fun MapScreen(uiState: MapState, onAction: (MapAction) -> Unit, mapView:
val isTimeAos = uiState.mapData?.isTimeAos ?: true
LaunchedEffect(uiState.track) {
// In grid mode the map is centered on the local grid square; following
// the satellite subpoint here would override that centering on every
// track update, so skip the tracking animation entirely.
if (uiState.isGridMode) return@LaunchedEffect
val firstPos = uiState.track?.firstOrNull()?.firstOrNull() ?: return@LaunchedEffect
mapView.controller.animateTo(GeoPoint(firstPos.latitude, firstPos.longitude))
}