GeoJSON types
The editable-layers module uses Turf.js 7, which in turn uses standard types from the geojson package for features, geometries, etc.
SimpleGeometry types
Editable layers operate on FeatureCollections that contain Features with any standard geojson geometry except GeometryCollection (which has a geometries property instead of geometry)
To simplify working with the library in TypeScript, the package exports a SimpleGeometry type (a union of all geometries except GeometryCollection), as well SimpleFeature, SimpleFeatureCollection, and SimpleCoordinates.
These are useful when building your own editing modes:
import { GeoJsonEditMode, SimpleFeatureCollection, ModeProps } from '@deck.gl-community/editable-layers';
export class MyEditMode extends GeoJsonEditMode {
handleClick(event: ClickEvent, props: ModeProps<SimpleFeatureCollection>) {
// custom logic here
}
}
A mode that handles drags should implement ownsPointerDown(event, props) and return true for
the presses its drag handlers use, so interleaved MapLibre/Mapbox maps can pan from the rest.
Without it, a mode that overrides a drag handler owns every press.