SimplifyInput
Thins a stored GeoJSON value with a tolerance slider and previews the result on a map: the form holds the simplified value. Every change simplifies from the first value, so sliding back to minTolerance restores it. quality picks the algorithm, High keeping more detail. A null value shows an empty state, and any other value than GeoJSON or null throws.
Thins a stored GeoJSON value with a tolerance slider and previews the result on a map: the form holds the simplified value. Every change simplifies from the first value, so sliding back to minTolerance restores it. quality picks the algorithm, High keeping more detail. A null value shows an empty state, and any other value than GeoJSON or null throws.
Installation
import { SimplifyInput } from "@chelone/react/maps/draw";See the maps guide for the subpaths, the optional packages and MapsProvider.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| defaultCenter | readonly [number, number] | — | `[lat, lng]`. Read once at mount. Defaults to `[0, 0]`. |
| height | string | number | — | In pixels, or any CSS length. Defaults to 400. |
| helperText | ReactNode | — | |
| label | ReactNode | — | The legend. A string is translated; `false` renders none. |
| mapStyle | MapStyleInput | — | Defaults to the style from `MapsProvider`. |
| maxTolerance | number | — | Defaults to 0.05. |
| minTolerance | number | — | Defaults to 0. |
| quality | SimplifyQuality | — | The initial algorithm. `High` is slower and keeps more detail. Defaults to `Default`. |
| shapeStyle | ShapeStyle | — | Partial over `DEFAULT_SHAPE_STYLE`. |
| source | SourceProp<TRecord> | — | The form field holding a Geometry, Feature or FeatureCollection. |
| step | number | — | Defaults to 0.001. |
| tolerance | number | — | The slider's initial value, in degrees. Defaults to 0.01. |
| zoom | number | — | Read once at mount. Defaults to 13. |