map-with-zoom-control

Previous
Docs
shadcn-mapexample

Preview

Loading preview…
registry/new-york-v4/examples/map-with-zoom-control.tsx
import {
    Map,
    MapTileLayer,
    MapZoomControl,
} from "@/registry/new-york-v4/ui/map"
import type { LatLngExpression } from "leaflet"

export function MapWithZoomControl() {
    const TORONTO_COORDINATES = [43.6532, -79.3832] satisfies LatLngExpression

    return (
        <Map center={TORONTO_COORDINATES}>
            <MapTileLayer />
            <MapZoomControl />
        </Map>
    )
}

Installation

npx shadcn@latest add @shadcn-map/map-with-zoom-control

Usage

import { MapWithZoomControl } from "@/components/map-with-zoom-control"
<MapWithZoomControl />