MapControlsViewModel
Manages the visibility and state of map controls (zoom, compass, my location, etc.). Handles visibility logic based on available space and route type.
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 state indicating whether the add road event button should be visible. Only shown in free roam mode when there's sufficient space.
Observable state indicating whether the compass control should be visible. Visibility depends on available vertical space.
Observable state indicating whether the follow button can be hidden. True for non-pedestrian routes, false for pedestrian routes.
Observable state indicating whether the my location (follow) button should be visible. This control has the highest priority and is shown when any space is available.
Observable state of the remaining vertical space after all visible controls are placed. Null if controls haven't been measured yet, otherwise the unused height in pixels.
Observable state indicating whether the traffic and parking button should be visible. Visibility depends on available space and whether the route is pedestrian.
Observable state indicating whether the zoom controls should be visible. Visibility depends on available vertical space.
Functions
Sets the measured height of the add road event button.
Sets the measured height of the compass control.
Sets the measured height of the my location (follow) button.
Updates the free roam state which affects the visibility of certain controls.
Sets the total available height for map controls area.
Sets the measured height of the traffic and parking control.
Sets the measured height of the zoom controls.