SharedMapViewModel

class SharedMapViewModel(mapPrefs: MapPrefs, nodeRepository: NodeRepository, packetRepository: PacketRepository, radioController: RadioController, radioConfigRepository: RadioConfigRepository, notificationPrefs: NotificationPrefs) : BaseMapViewModel(source)

Constructors

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

Properties

Link copied to clipboard
val channelSet: StateFlow<ChannelSet?>

Connected radio's channel set (primary-channel frequency + LoRa config); used to prefill a Site Planner estimate.

Link copied to clipboard
val displayUnits: StateFlow<Config.DisplayConfig.DisplayUnits>

OS locale display units (metric/imperial) for distance/altitude/speed formatting across map surfaces. StateFlow kept for the existing collectAsState call sites; value is a one-time snapshot at construction and does not react to a mid-session locale change (ViewModel survives config changes).

Link copied to clipboard
val geofenceAlertOptIns: StateFlow<Set<Int>>

Waypoint ids of foreign geofences the user opted in to crossing alerts for (see NotificationPrefs).

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

True if the waypoint with id was created by this device (vs. received from another node over the mesh).

Link copied to clipboard
fun sendWaypoint(wpt: Waypoint, contactKey: String = "0")
Link copied to clipboard
fun setGeofenceAlertOptIn(waypointId: Int, enabled: Boolean)
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.