MultiPointInput

Form input for drawing a GeoJSON.MultiPoint. Each marker drawn is combined into a single MultiPoint value.

Installation

pnpm dlx shadcn@latest add @shadmin/multi-point-input

Usage

import { MultiPointInput } from "@/components/leaflet";
 
<Create>
  <SimpleForm>
    <MultiPointInput
      source="geom"
      label="Bus stops"
      defaultCenter={[48.85, 2.35]}
    />
  </SimpleForm>
</Create>;

Props

PropRequiredTypeDefaultDescription
sourceRequiredstring-RHF field to write the geometry to.
zoomOptionalnumber13Initial zoom level.
defaultCenterOptional[number, number][0, 0]Initial map center [lat, lng].
heightOptionalnumber | string300Height of the map container.
tileUrlOptionalstringOpenStreetMap tile URLTile layer URL template.
attributionOptionalstringOSM attributionTile attribution string.
pathOptionsOptionalL.PathOptions-Vector styling for the drawn layers.
snappableOptionalbooleantrueEnable Geoman snap-to-vertex.
snapDistanceOptionalnumber20Snap radius in pixels.
labelOptionalReactNode-Label rendered above the map.
helperTextOptionalReactNode-Helper text rendered below the map.
disabledOptionalbooleanfalseDisable editing.
validateOptional(v) => string | undefined-RHF-compatible validator(s).