DefaultTrafficLineViewModel
Default implementation of TrafficLineViewModel that manages traffic line visualization state and route objects.
This ViewModel:
Tracks user's position along the route
Manages traffic speed color data for the route visualization
Handles traffic objects (accidents, road works, intermediate points) visibility
Provides reactive updates as the user progresses along the route
Important: Call onCleared when this ViewModel is no longer needed to properly release resources and close all connections to prevent memory leaks.
Parameters
Provides navigation state and route information updates.
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.