DefaultMapControlsViewModel
Default implementation of MapControlsViewModel.
This ViewModel manages the visibility of map controls based on available space and navigation state. For proper operation, the free roam state must be set via setIsFreeRoam method, which affects the visibility of certain controls like the add road event button.
Properties
Observable state indicating whether the add road event button should be visible. Shown when all conditions are met:
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. Used for calculating visibility based on available space.
Sets the measured height of the compass control. Used for calculating visibility based on available space.
Sets the measured height of the my location (follow) button. Used for calculating visibility based on available space.
Updates the free roam state which affects the visibility of certain controls. In free roam mode, the add road event button may be shown if space permits.
Sets the total available height for map controls area. This triggers recalculation of which controls can fit in the available space.
Sets the measured height of the traffic and parking control. Used for calculating visibility based on available space.
Sets the measured height of the zoom controls. Used for calculating visibility based on available space.