The <x-map-controls> component adds standard interactive controls to the map such as zoom buttons, compass, geolocation, fullscreen toggle, and a scale bar. Nest it inside <x-map>.
Enable the scale bar to show distance measurement on the map:
Controls can be placed in any of the four map corners using the position prop:
(default)
| Prop | Type | Default | Description |
|---|---|---|---|
| :zoom | bool | true | Show zoom in/out buttons |
| :compass | bool | true | Show compass / bearing reset |
| :locate | bool | true | Show geolocation button |
| :fullscreen | bool | false | Show fullscreen toggle |
| :scale | bool | false | Show map scale bar |
| position | string | 'top-right' | Control position on map |