TrafficLineViewModel
ViewModel interface for managing traffic line visualization state and route objects.
Responsible for:
Tracking user's position along the route
Managing traffic speed color data for the route visualization
Handling traffic objects (accidents, road works, intermediate points) visibility
Providing reactive updates as the user progresses along the route
Thread Safety
This ViewModel is not thread-safe and must only be accessed from the Main thread.
All methods must be called from the Main (UI) thread
All StateFlow properties emit values on the Main thread
Concurrent access from multiple threads may lead to undefined behavior
Inheritors
Properties
Observable traffic line information containing data needed to render the traffic visualization. Includes route length and traffic speed color entries. Null when no traffic data is available or the component is not properly initialized.
Observable list of traffic objects to be displayed along the route. Includes accidents, road works, and intermediate route points. Objects are automatically filtered based on user position and include removal state for animations.