BaseMapViewModel

open class BaseMapViewModel(mapPrefs: MapPrefs, nodeRepository: NodeRepository, packetRepository: PacketRepository, radioController: RadioController) : ViewModel(source)

Shared base ViewModel for the map feature, providing node data, waypoints, map filter preferences, and traceroute overlay state.

Platform-specific map ViewModels (fdroid/google) extend this to add flavor-specific map provider logic.

Inheritors

Constructors

Link copied to clipboard
constructor(mapPrefs: MapPrefs, nodeRepository: NodeRepository, packetRepository: PacketRepository, radioController: RadioController)

Types

Link copied to clipboard
data class MapFilterState(val onlyFavorites: Boolean, val showWaypoints: Boolean, val showPrecisionCircle: Boolean, val lastHeardFilter: LastHeardFilter, val lastHeardTrackFilter: LastHeardFilter)

Properties

Link copied to clipboard
val isConnected: StateFlow<Boolean>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val myId: StateFlow<String?>
Link copied to clipboard
val myNodeInfo: StateFlow<MyNodeInfo?>
Link copied to clipboard
Link copied to clipboard
val nodes: StateFlow<List<Node>>
Link copied to clipboard
val nodesWithPosition: StateFlow<List<Node>>
Link copied to clipboard
val ourNodeInfo: StateFlow<Node?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val showWaypointsOnMap: StateFlow<Boolean>
Link copied to clipboard
val waypoints: StateFlow<Map<Int, DataPacket>>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun deleteWaypoint(id: Int): Job
Link copied to clipboard
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun getNodeOrFallback(nodeNum: Int): Node
Link copied to clipboard
open fun getUser(userId: String?): User
Link copied to clipboard
fun sendWaypoint(wpt: Waypoint, contactKey: String = "0")
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun BaseMapViewModel.tracerouteNodeSelection(tracerouteOverlay: TracerouteOverlay?, tracerouteNodePositions: Map<Int, Position>, nodes: List<Node>): TracerouteNodeSelection

Convenience extension that delegates to tracerouteNodeSelection using the VM's getNodeOrFallback.