Controls

NavigationControl

The NavigationControl component adds zoom and rotation controls to the map, providing users with an intuitive way to interact with the map’s view.

These controls are typically displayed as buttons, allowing users to zoom in, zoom out, and rotate the map without needing to use gestures or keyboard shortcuts.

Reference: NavigationControl

Usage

Adding the NavigationControl to your map is straightforward, and you can customize its position on the map for optimal user experience.

This control enhances map navigation by making it more accessible, especially for users who prefer buttons over gestures or mouse interactions.

API

Props

The NavigationControl component’s props.

PropDescriptionType
positionA position defintion for the control to be placed, can be in one of the corners of the map. When two or more controls are places in the same location they are stacked toward the center of the map.Optional ControlPosition
showCompassIf true the compass button is included.Optional boolean default is true
showZoomIf true the zoom-in and zoom-out buttons are included.Optional boolean default is true
visualizePitchIf true the pitch is visualized by rotating X-axis of compass.Optional boolean default is false
Previous
LogoControl