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.
Loading preview…
One field per GeoJSON type, each GeoJsonField under another name. They exist so
an app migrating from shadmin changes no import. All nine take the props of
GeoJsonField and show any GeoJSON value, so PolygonField also draws a
LineString.
Installation
import {
FeatureCollectionField,
FeatureField,
GeometryCollectionField,
LineStringField,
MultiLineStringField,
MultiPointField,
MultiPolygonField,
PointField,
PolygonField,
} from "@chelone/react/maps";See the maps guide for the subpaths, the optional packages and MapsProvider.
Each type has its own page: PointField, PolygonField and the rest of the Shape fields.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| defaultValue | unknown | — | Used when the property is `undefined`. |
| emptyText | string | — | Replaces the translation of `chelone.map.no_geometry`. |
| fitBounds | boolean | — | Frame the map around the data. Defaults to true. |
| fitPadding | number | — | Pixels kept free around the fitted box. Defaults to 20. |
| height | string | number | — | In pixels, or any CSS length. Defaults to 300. |
| mapStyle | MapStyleInput | — | Defaults to the style from `MapsProvider`. |
| maxFitZoom | number | — | The highest zoom a fit may reach, which also sets a single Point's zoom. Defaults to 18. |
| record | RecordType | — | Defaults to the ambient record. |
| scrollZoom | boolean | — | Zoom with the mouse wheel. Defaults to false so the page still scrolls. |
| shapeStyle | ShapeStyle | — | Partial over `DEFAULT_SHAPE_STYLE`. |
| source | SourceProp<RecordType> | — | The record property holding the GeoJSON value. |