Maps

Maps for showing and drawing GeoJSON, over the services you set.

Fields

Shape fields

Shape fields

One field per GeoJSON type, each GeoJsonField under another name: PointField, MultiPointField, LineStringField, MultiLineStringField, PolygonField, MultiPolygonField, GeometryCollectionField, FeatureField and FeatureCollectionField. They exist so an app migrating from shadmin changes no import.

PointField

Shows a GeoJSON Point from a record on a map as a circle marker, zoomed to maxFitZoom, 18 by default. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

MultiPointField

Shows a GeoJSON MultiPoint from a record on a map, one circle per coordinate. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

LineStringField

Shows a GeoJSON LineString from a record on a map as a line 3 pixels wide, which shapeStyle restyles. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

MultiLineStringField

Shows a GeoJSON MultiLineString from a record on a map, one line per part. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

PolygonField

Shows a GeoJSON Polygon from a record on a map, filled at 0.2 opacity and outlined 3 pixels wide, both through shapeStyle. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

MultiPolygonField

Shows a GeoJSON MultiPolygon from a record on a map, one filled part per polygon. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

GeometryCollectionField

Shows a GeoJSON GeometryCollection from a record on a map, drawing each geometry by its own type. A collection with no coordinates shows the empty text panel. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

FeatureField

Shows the geometry of a GeoJSON Feature from a record on a map. Its properties are not rendered. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

FeatureCollectionField

Shows every geometry of a GeoJSON FeatureCollection from a record on a map. A feature with a null geometry is left out. It is GeoJsonField under the name of a GeoJSON type, so it takes the same props.

Inputs

Shape inputs

PointInput

Edits a GeoJSON Point by drawing on a map with draw-point, move and delete. A new point replaces the old one. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

MultiPointInput

Edits a GeoJSON MultiPoint by drawing on a map with draw-point, edit, move and delete. Each point is its own feature on the map. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

LineStringInput

Edits a GeoJSON LineString by drawing on a map with draw-line, edit, move and delete. A new line replaces the old one. snapToRoads snaps each drawn or edited line to the road network through the MapsProvider router, and throws when there is none. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

MultiLineStringInput

Edits a GeoJSON MultiLineString by drawing on a map with draw-line, edit, move and delete. Each line is its own feature on the map. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

PolygonInput

Edits a GeoJSON Polygon by drawing on a map with draw-polygon, draw-rectangle, draw-circle, cut, edit, move and delete. A new drawing replaces the old one. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

MultiPolygonInput

Edits a GeoJSON MultiPolygon with the tools of PolygonInput. Each part is its own feature on the map, and a part with a hole draws read-only and stays in the value. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

GeometryCollectionInput

Edits a GeoJSON GeometryCollection with every draw tool, then cut, edit, move and delete. Every shape stays in the value. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

GeoJsonInput

Edits any one GeoJSON geometry, or with collection a GeometryCollection, limited to the shapes the user may draw, all three by default. Without collection a new drawing replaces the old one. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

FeatureInput

Edits a GeoJSON Feature with the tools of its shape, Polygon by default. An edit keeps the feature's id and properties. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

FeatureCollectionInput

Edits a GeoJSON FeatureCollection with the tools of its allowedShapes, Point, LineString and Polygon by default. Each feature keeps its own properties when another is removed. It is ShapeInput under the name of a GeoJSON type, with kind set for you.

Geocoding and OpenStreetMap

GeocodingInput

Searches an address with a geocoding provider and writes the result the user picks to the form: its name to source, its latitude to latSource, its longitude to lngSource and its box to bboxSource, when the result has one. A provider that allows typeahead searches as the user types, after debounceMs; any other searches on Enter or on the Search button. Text typed by hand is saved when the field loses focus and clears latSource, lngSource and bboxSource, so they never describe a different address. Needs a provider, from provider or MapsProvider.

MapWithSearch

An address search over a map: a <GeocodingInput> on addressSource above a map with a pin on latSource and lngSource. Picking a result fills all three fields and moves the pin. Clicking the map or dragging the pin writes the address of that spot, unless the service finds none, and the lookup runs only after such a gesture, never on mount and never after a pick, so a picked address is never overwritten. Needs the optional maplibre-gl peer.

ReverseGeocodeField

Names the position held in two record fields, latSource and lngSource, as an address read from a geocoding provider. format keeps the whole name, or shortens it to its first part with street or to its first two with city. Renders nothing when either field is not a number or a numeric string, a skeleton while the lookup runs, and the coordinates to 4 decimals when the provider knows no place. Needs a provider, from provider or MapsProvider.

OsmFeatureOperator

A button that edits the Polygon or MultiPolygon held in source with OpenStreetMap areas queried from Overpass by presets and tags: mode subtract removes them and add merges them in. The request runs on the click, and the result is written like a user edit, so the form turns dirty and the field's validators run. A cut or merge that would leave a Polygon as several pieces is refused with a warning and the value is left as it was. Needs an Overpass provider, from provider or MapsProvider. OsmFeatureAdd and OsmFeatureSubtract are this component with mode set for you.

OsmFeatureAdd

A button that merges OpenStreetMap areas into the Polygon or MultiPolygon held in source, queried from Overpass by presets and tags. The request runs on the click, and the result is written like a user edit, so the form turns dirty and the field's validators run. A merge that would leave a Polygon as several pieces is refused with a warning and the value is left as it was. Needs an Overpass provider, from provider or MapsProvider. It is OsmFeatureOperator with mode set to add for you.

OsmFeatureSubtract

A button that removes OpenStreetMap areas, such as the water in a delivery area, from the Polygon or MultiPolygon held in source, queried from Overpass by presets and tags. The request runs on the click, and the result is written like a user edit, so the form turns dirty and the field's validators run. Areas that cover the value entirely clear the field to null, and a cut that would leave a Polygon as several pieces is refused with a warning and the value is left as it was. Needs an Overpass provider, from provider or MapsProvider. It is OsmFeatureOperator with mode set to subtract for you.