Map (Leaflet)
Interactive maps, markers, and geocoding with Leaflet.
Optional Leaflet-based map fields, form inputs, drawing/editing primitives, OSM utilities, and geocoding for Shadmin.
Hooks and pure helpers for querying OpenStreetMap data and performing geometric operations. Used by <OsmFeatureSubtract>, <OsmFeatureAdd>, and <LineStringInput snapToRoads>, and available for custom workflows.
A composite map input pairing a draggable Leaflet marker with an address-search combobox, kept in two-way sync.
Combobox-style address search input backed by Nominatim (or a custom provider). On selection, writes the display name to source and optionally writes latitude, longitude, and bbox to companion form fields.
Read-only field that displays a human-readable address resolved from a lat/lng pair on the current record. Falls back to truncated coordinates while loading or when reverse geocoding returns no result.
Read-only Leaflet map that renders a GeoJSON.BBox ([west, south, east, north]) as a rectangular polygon stored at a record field.
Form input for drawing an axis-aligned bounding box. The drawn rectangle is converted on save to a GeoJSON.BBox tuple ([west, south, east, north]), and existing bbox values are hydrated back into a rectangle layer for editing.
Read-only Leaflet map with a marker at the lat/lng pair read from the current record. Renders an empty-state panel when either coordinate is missing.
Form input that renders a draggable Leaflet marker. Clicking the map or dragging the marker writes to two React Hook Form fields (latSource and lngSource).
Read-only Leaflet map that renders a GeoJSON.Point geometry stored at a record field.
Form input for drawing a GeoJSON.Point. Renders a Geoman toolbar with the marker tool active.
Read-only Leaflet map that renders a GeoJSON.MultiPoint geometry stored at a record field.
Form input for drawing a GeoJSON.MultiPoint. Each marker drawn is combined into a single MultiPoint value.
Read-only Leaflet map that renders a GeoJSON.LineString geometry stored at a record field.
Form input for drawing a GeoJSON.LineString. Optionally snaps drawn lines to the OSM road network via OSRM.
Read-only Leaflet map that renders a GeoJSON.MultiLineString geometry stored at a record field.
Form input for drawing a GeoJSON.MultiLineString. Each drawn polyline is combined into a single MultiLineString value.
Read-only Leaflet map that renders a GeoJSON.Polygon geometry stored at a record field.
Form input for drawing a GeoJSON.Polygon. Renders a Geoman toolbar with the polygon and cut tools.
Read-only Leaflet map that renders a GeoJSON.MultiPolygon geometry stored at a record field.
Form input for drawing a GeoJSON.MultiPolygon. Each drawn polygon is combined into a single MultiPolygon value.
Read-only Leaflet map that renders a GeoJSON.GeometryCollection (mixed point/line/polygon geometries) stored at a record field.
Form input for drawing a GeoJSON.GeometryCollection. All drawn shapes are stored together as a single GeometryCollection value.
Read-only Leaflet map that renders a GeoJSON.Feature stored at a record field. Leaflet's L.geoJSON accepts Features directly, so this is a thin wrapper around the shared shape-field shell.
Form input for drawing and editing a GeoJSON.Feature. Writes { type: "Feature", geometry, properties } to the form value; preserves properties across edits so attribute data isn't lost when the user reshapes the geometry.
Read-only Leaflet map that renders a GeoJSON.FeatureCollection stored at a record field. L.geoJSON renders the collection as a single multi-layer group — one layer per feature.
Form input for drawing and editing a GeoJSON.FeatureCollection. Each drawn shape becomes a Feature in the collection; properties are carried forward from the previous form value by index on every edit.
Polymorphic read-only Leaflet field that renders any GeoJSON geometry (Point, LineString, Polygon, Multi\*, or GeometryCollection) stored at a record field.
Polymorphic form input for drawing any GeoJSON geometry. Renders a Geoman toolbar with one button per allowed shape kind. Defaults to allowing Point, LineString, and Polygon.
Form button that unions OSM features matching one or more typed presets (curated subsets like water, buildings, forest, roads, plus per-key category catch-alls like amenity, leisure, natural) and/or raw OSM tags (e.g. leisure=park) onto the polygon stored at a form field. Useful for extending a coverage region to include neighboring forest patches, lakes, or other features that the user wants part of the final area.
Form button that subtracts OSM features matching one or more typed presets (curated subsets like water, buildings, forest, roads, plus per-key category catch-alls like amenity, leisure, natural) and/or raw OSM tags (e.g. natural=water, building=*) from the polygon stored at a form field. Useful for trimming service areas to land, excluding building footprints, removing forested patches, or carving out major roads.
Form-aware control that simplifies a GeoJSON shape stored in the form value using @turf/simplify (Douglas-Peucker). Renders a Leaflet preview of the simplified result, a tolerance slider, and a quality toggle.
Hook that bridges Geoman draw/edit/remove/cut events to a React Hook Form field. Manages a L.FeatureGroup that holds the in-progress geometry layers and serializes them back to GeoJSON on every change.