← All components
Controls
Zoom, compass, locate, fullscreen and a theme switcher built from shadcn buttons.
Previews run on MapScale's public Thailand archive.
Install
npx shadcn@latest add https://mapscale.io/r/map-controls.jsonUsage
import { MapControls } from "@/components/mapscale/map-controls"
<Map>
<MapControls position="top-right" locate fullscreen styleSwitcher />
</Map>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| position | corner | "top-right" | Corner of the map: top-left, top-right, bottom-left or bottom-right. |
| zoom | boolean | true | Zoom in and out buttons. |
| compass | boolean | true | Compass that resets bearing and pitch. |
| locate | boolean | false | Button that flies to the visitor's location. |
| fullscreen | boolean | false | Fullscreen toggle for the whole map. |
| styleSwitcher | boolean | false | Menu that swaps the basemap theme without remounting. |
Keys
Maps, autocomplete and place details use a publishable pk_ key that is safe in the browser. Routing and isochrones need a secret sk_ key, so they go through the proxy route your app serves.