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.

Loading preview…

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

PropTypeDefaultDescription
classNamestring—
defaultCenterreadonly [number, number]—`[lat, lng]`. Read once at mount. Defaults to `[0, 0]`.
heightstring | number—In pixels, or any CSS length. Defaults to 400.
helperTextReactNode—
labelReactNode—The legend. A string is translated; `false` renders none.
mapStyleMapStyleInput—Defaults to the style from `MapsProvider`.
maxTolerancenumber—Defaults to 0.05.
minTolerancenumber—Defaults to 0.
qualitySimplifyQuality—The initial algorithm. `High` is slower and keeps more detail. Defaults to `Default`.
shapeStyleShapeStyle—Partial over `DEFAULT_SHAPE_STYLE`.
sourceSourceProp<TRecord>—The form field holding a Geometry, Feature or FeatureCollection.
stepnumber—Defaults to 0.001.
tolerancenumber—The slider's initial value, in degrees. Defaults to 0.01.
zoomnumber—Read once at mount. Defaults to 13.