Laravel Mapcn
Toggle sidebar

Controls

Docs / Controls

Overview

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>.

Basic Usage

With Scale Bar

Enable the scale bar to show distance measurement on the map:

Positioning

Controls can be placed in any of the four map corners using the position prop:

top-left

top-right

(default)

bottom-left

bottom-right

Props

PropTypeDefaultDescription
:zoombooltrueShow zoom in/out buttons
:compassbooltrueShow compass / bearing reset
:locatebooltrueShow geolocation button
:fullscreenboolfalseShow fullscreen toggle
:scaleboolfalseShow map scale bar
positionstring'top-right'Control position on map