UNPKG

geospatialdraw

Version:
37 lines (36 loc) 1.51 kB
import DrawingContext from './drawing-context'; import UpdatedGeoReceiver from './geo-receiver'; import DrawingControl from './drawing-control'; import { Shape } from '../shape-utils'; import { GeometryJSON, GeometryJSONProperties } from '../geometry'; import GeoJSON from 'ol/format/GeoJSON'; import Feature from 'ol/Feature'; import { Type } from 'ol/geom/Geometry'; type GeoProps = GeometryJSONProperties & { [index: string]: any; }; declare abstract class BasicDrawingControl implements DrawingControl { protected context: DrawingContext; protected receiver: UpdatedGeoReceiver; protected geoFormat: GeoJSON; protected mouseDragActive: boolean; protected drawingActive: boolean; protected properties: GeoProps; abstract setGeo(geoJSON: GeometryJSON): void; abstract startDrawing(): void; protected constructor(context: DrawingContext, receiver: UpdatedGeoReceiver); setProperties(properties: GeoProps): void; getProperties(): GeoProps; protected applyPropertiesToFeature(feature: Feature): void; protected abstract getShape(): Shape; protected abstract getGeoType(): Type; protected featureToGeo(feature: Feature): GeometryJSON; protected writeExtendedGeoJSON(feature: Feature): GeometryJSON; cancelDrawing(): void; setActive(active: boolean): void; isActive(): boolean; isMouseDragActive(): boolean; isDrawing(): boolean; updateBuffer(buffer: number, bufferUnit: string): void; } export default BasicDrawingControl;