Loading...
Loading...
Compare original and translation side by side
integrate mapcnadd mapcn to shadcn projectmapcn MapControls/Markers/Routes/Clusterscontrolled map viewport with mapcnuseMap hook mapcnMapLibre with mapcn componentsintegrate mapcnadd mapcn to shadcn projectmapcn MapControls/Markers/Routes/Clusterscontrolled map viewport with mapcnuseMap hook mapcnMapLibre with mapcn componentsnpx shadcn@latest add @mapcn/mapcomponents/uiimport { Map } from "@/components/ui/map";npx shadcn@latest add @mapcn/mapcomponents/uiimport { Map } from "@/components/ui/map";MapMapControlsimport { Map, MapControls } from "@/components/ui/map";
export function BasicMap() {
return (
<div className="h-[500px] w-full overflow-hidden rounded-xl border">
<Map
initialViewState={{
longitude: -58.3816,
latitude: -34.6037,
zoom: 11,
}}
>
<MapControls
showZoom
showCompass
showLocate
showFullscreen
position="top-right"
/>
</Map>
</div>
);
}MapControlsMapimport { Map, MapControls } from "@/components/ui/map";
export function BasicMap() {
return (
<div className="h-[500px] w-full overflow-hidden rounded-xl border">
<Map
initialViewState={{
longitude: -58.3816,
latitude: -34.6037,
zoom: 11,
}}
>
<MapControls
showZoom
showCompass
showLocate
showFullscreen
position="top-right"
/>
</Map>
</div>
);
}const [viewport, setViewport] = useState({
longitude: -58.3816,
latitude: -34.6037,
zoom: 11,
});
<Map viewport={viewport} onViewportChange={setViewport} />const [viewport, setViewport] = useState({
longitude: -58.3816,
latitude: -34.6037,
zoom: 11,
});
<Map viewport={viewport} onViewportChange={setViewport} />MapControlsshowZoomshowCompassshowLocateshowFullscreenpositionMapControlsshowZoomshowCompassshowLocateshowFullscreenpositionMapMarkerMarkerContentMarkerPopupMarkerTooltipMarkerLabelMapMarkerMarkerContentMarkerPopupMarkerTooltipMarkerLabelMapPopupMapPopupMapRouteMapRouteMapClusterLayerMapClusterLayerMapRefMapRefMapRefflyToMapRefflyTouseMapuseMapuseMapuseMapstylesstylesMapClusterLayerMapClusterLayerreferences/docs-pages.mdreferences/api-cheatsheet.mdhttps://www.mapcn.dev/docshttps://www.mapcn.dev/docs/installationhttps://www.mapcn.dev/docs/api-referencehttps://www.mapcn.dev/docs/basic-maphttps://www.mapcn.dev/docs/controlshttps://www.mapcn.dev/docs/markershttps://www.mapcn.dev/docs/popupshttps://www.mapcn.dev/docs/routeshttps://www.mapcn.dev/docs/clustershttps://www.mapcn.dev/docs/advanced-usagereferences/docs-pages.mdreferences/api-cheatsheet.mdhttps://www.mapcn.dev/docshttps://www.mapcn.dev/docs/installationhttps://www.mapcn.dev/docs/api-referencehttps://www.mapcn.dev/docs/basic-maphttps://www.mapcn.dev/docs/controlshttps://www.mapcn.dev/docs/markershttps://www.mapcn.dev/docs/popupshttps://www.mapcn.dev/docs/routeshttps://www.mapcn.dev/docs/clustershttps://www.mapcn.dev/docs/advanced-usage