import type { Feature } from 'ol'; import type { Geometry } from 'ol/geom'; import type { StyleLike } from 'ol/style/Style'; import React from 'react'; import type { DrawModeExitCallback, DrawModeValue } from './types'; export interface OpenLayersMapDrawProps { geojson: GeoJSON.FeatureCollection; drawMode?: DrawModeValue; viewOnlyStyle: StyleLike; exitDrawModeCallback?: (reason: DrawModeExitCallback) => void; isInEditMode: boolean; selectedFeatureIndex: number; updateGeojson?: (geoJson: GeoJSON.FeatureCollection, text: string) => void; onViewOnlyFeatureClick?: (feature: Feature[]) => void; onNoFeatureClick?: () => void; } /** * Integrates with OpenLayers Draw and Modify (+Snap) interactions, to implement feature drawing * and modification behaviour. * * There is a corner case where this fails: the user will only be able to edit the existing * feature (not add) when there are 1) multiple features in the geojson, and 2) the * selectedFeatureIndex points to a feature with of the same type as drawMode is going to draw. To * fix this properly, it would be better that the surrounding code would add a placeholder feature * in the geojson and then activate drawing at that feature index. This means the openlayers version * works slightly differently from the WebMapJS version, but since the multi-feature edit feature * is not really a requirement for any production workflows, this functionality was left as is. */ export declare const OpenLayersMapDraw: React.FC;