API Reference
Control
API reference for map controls in 3DMapFi.
Controls are UI elements that enhance map interaction. 3DMapFi provides several built-in controls and supports custom controls for advanced use cases.
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-left
top-right
bottom-left
bottom-right
Custom Controls
You can create custom controls by implementing onAdd
and onRemove
methods. Custom controls can include any HTML content and logic.
Removing Controls
Remove a control by passing the control instance to removeControl
.
Accessibility
- Use semantic HTML and ARIA attributes in custom controls for accessibility.
- Ensure controls are keyboard navigable.
See also: Map API