Built-in Controls
- NavigationControl: Zoom and rotate the map.
- FullscreenControl: Toggle fullscreen mode.
- GeolocateControl: Show user’s current location.
- ScaleControl: Display a scale bar.
- AttributionControl: Show attribution information.
Usage
Control Positions
Controls can be positioned at:top-lefttop-rightbottom-leftbottom-right
Custom Controls
You can create custom controls by implementingonAdd and onRemove methods. Custom controls can include any HTML content and logic.
Removing Controls
Remove a control by passing the control instance toremoveControl.
Accessibility
- Use semantic HTML and ARIA attributes in custom controls for accessibility.
- Ensure controls are keyboard navigable.