TrafficViewModel

Manages the state and behavior of the traffic control. Implementations push updates as the traffic state changes.

Inheritors

Properties

Link copied to clipboard
abstract val score: StateFlow<Int?>

Observable state of the current traffic score (congestion level). null means the score is not available (e.g., region without traffic data).

Link copied to clipboard
abstract val status: StateFlow<TrafficControlStatus>

Observable state of the current traffic control status. Determines the visual state of the control (enabled, disabled, loading, hidden).

Functions

Link copied to clipboard
abstract fun onCleared()

Releases resources when the view model is no longer needed.

Link copied to clipboard
abstract fun onClicked()

Called when the user clicks the traffic button. Typically toggles traffic layer visibility on the map.