← All components
Popup
A popup that is a normal shadcn card, anchored to a coordinate.
Previews run on MapScale's public Thailand archive.
Install
npx shadcn@latest add https://mapscale.io/r/map-popup.jsonUsage
import { MapPopup } from "@/components/mapscale/map-popup"
<Map>
{open ? (
<MapPopup lngLat={[100.5018, 13.7563]} onClose={() => setOpen(false)}>
<p className="font-medium">Wat Arun</p>
</MapPopup>
) : null}
</Map>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| lngLat | [number, number] | - | Popup position as [lng, lat]. |
| onClose | () => void | - | Shows a close button and closes on Escape. |
| offset | number | 14 | Pixels between the coordinate and the popup tail. |
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.