Traceroute map position snapshots (#4035)

Signed-off-by: Jord <650645+DivineOmega@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jord 2025-12-18 14:14:03 +00:00 committed by GitHub
parent 03fd2bf9ba
commit 9833795864
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1195 additions and 44 deletions

View file

@ -144,6 +144,7 @@ fun MapView(
focusedNodeNum: Int? = null,
nodeTracks: List<Position>? = null,
tracerouteOverlay: TracerouteOverlay? = null,
tracerouteNodePositions: Map<Int, Position> = emptyMap(),
onTracerouteMappableCountChanged: (shown: Int, total: Int) -> Unit = { _, _ -> },
) {
val context = LocalContext.current
@ -262,7 +263,14 @@ fun MapView(
.collectAsStateWithLifecycle(listOf())
val waypoints by mapViewModel.waypoints.collectAsStateWithLifecycle(emptyMap())
val displayableWaypoints = waypoints.values.mapNotNull { it.data.waypoint }
val overlayNodeNums = remember(tracerouteOverlay) { tracerouteOverlay?.relatedNodeNums ?: emptySet() }
val tracerouteSelection =
remember(tracerouteOverlay, tracerouteNodePositions, allNodes) {
mapViewModel.tracerouteNodeSelection(
tracerouteOverlay = tracerouteOverlay,
tracerouteNodePositions = tracerouteNodePositions,
nodes = allNodes,
)
}
val filteredNodes =
allNodes
@ -275,7 +283,7 @@ fun MapView(
val displayNodes =
if (tracerouteOverlay != null) {
allNodes.filter { overlayNodeNums.contains(it.num) }
tracerouteSelection.nodesForMarkers
} else {
filteredNodes
}