mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
fix(map): stop satellite tracking animation in grid mode so it stays centered on the local grid
This commit is contained in:
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))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user