import * as _angular_core from '@angular/core'; import { Signal } from '@angular/core'; import { Source, Vector } from 'ol/source'; import { Draw, Modify, DragBox, Snap } from 'ol/interaction'; import { EventsKey } from 'ol/events'; import { Feature } from 'ol'; import { Layer, Vector as Vector$1 } from 'ol/layer'; import { HsLaymanBrowserService, HsAddDataVectorService, HsAddDataOwsService } from 'hslayers-ng/services/add-data'; import { HsCommonLaymanService, HsCommonLaymanLayerService } from 'hslayers-ng/common/layman'; import { HsConfig } from 'hslayers-ng/config'; import { HsDialogContainerService } from 'hslayers-ng/common/dialogs'; import { Subject } from 'rxjs'; import { HsEventBusService } from 'hslayers-ng/services/event-bus'; import { HsLanguageService } from 'hslayers-ng/services/language'; import { HsLaymanService } from 'hslayers-ng/services/save-map'; import { HsLayoutService } from 'hslayers-ng/services/layout'; import { HsLogService } from 'hslayers-ng/services/log'; import { HsMapService } from 'hslayers-ng/services/map'; import { HsQueryBaseService, HsQueryVectorService } from 'hslayers-ng/services/query'; import { HsToastService } from 'hslayers-ng/common/toast'; declare class HsDrawServiceParams { drawableLayers: Array>; /** * Drawable layers available on Layman not currently added to map */ drawableLaymanLayers: Array; /** * Whether there are some available drawable layers either visible in map or on server */ drawableLayersAvailable: boolean; /** * Whether there are some drawable layers in a map */ hasSomeDrawables: boolean; /** * Whether there are multiple drawable layers in a map */ moreThanOneDrawable: boolean; draw: Draw; modify: Modify; boxSelection: DragBox; boxSelectionActive: boolean; /** * Snap interaction */ snap: Snap; snapActive: boolean; snapSource: Vector; snapLayer: Vector$1>; /** * String of type GeometryType */ type: 'Point' | 'Polygon' | 'LineString' | 'Circle'; selectedLayer: Vector$1>; tmpDrawLayer: any; source: Vector; drawActive: boolean; selectedFeatures: any; toggleSelectionString: string; onSelected: any; currentStyle: any; /** * Toggles toolbar button 'Draw' class */ highlightDrawButton: boolean; onDeselected: any; laymanEndpoint: any; previouslySelected: any; isAuthenticated: Signal; onlyMine: boolean; addedLayersRemoved: boolean; eventHandlers: EventsKey[]; drawingLayerChanges: Subject<{ layer: Layer; source: Vector; }>; layerMetadataDialog: Subject; requiredSymbolizer: { Point: string[]; Polygon: string[]; LineString: string[]; Circle: string[]; }; } type ActivateParams = { onDrawStart?: any; onDrawEnd?: any; onSelected?: any; onDeselected?: any; changeStyle?: any; drawState?: boolean; }; declare const TMP_LAYER_TITLE = "tmpDrawLayer"; declare class HsDrawService extends HsDrawServiceParams { hsMapService: HsMapService; hsEventBusService: HsEventBusService; hsLayoutService: HsLayoutService; hsDialogContainerService: HsDialogContainerService; hsLogService: HsLogService; hsConfig: HsConfig; hsQueryBaseService: HsQueryBaseService; hsQueryVectorService: HsQueryVectorService; hsLaymanService: HsLaymanService; hsLanguageService: HsLanguageService; hsLaymanBrowserService: HsLaymanBrowserService; hsAddDataVectorService: HsAddDataVectorService; hsCommonLaymanService: HsCommonLaymanService; hsCommonLaymanLayerService: HsCommonLaymanLayerService; hsToastService: HsToastService; hsAddDataOwsService: HsAddDataOwsService; private hsRemoveLayerDialogService; private zone; private platformId; isAuthenticated: _angular_core.Signal; pendingLayers: _angular_core.WritableSignal; constructor(); /** * selectedLayerString * @returns Possibly translated name of layer selected for drawing */ selectedLayerString(): string; /** * snapLayerString * @returns Possibly translated name of layer selected for snapping */ snapLayerString(): string; saveDrawingLayer(): void; setType(what: any): boolean; /** * Handles drawing layer selection/change by activating drawing for selected layer. * In case of Layman layer not yet existing in app it pulls the layer first. */ selectLayer(layer: any): Promise; /** * Add draw layer to the map and repopulate list of drawables. */ addDrawLayer(layer: Vector$1>): void; /** * @param changeStyle - controller callback function * Update draw style without necessity to reactivate drawing interaction */ updateStyle(changeStyle: any): void; onDrawEnd(e: any): void; /** * Adds drawn feature to selection */ addFeatureToSelector(feature: any): void; /** * Re-enables getFeatureInfo info and cleans up after drawing */ afterDrawEnd(): void; removeLastPoint(): void; /** * Sets layer source where new drawing should be pushed to... after 'selectedLayer' change */ changeDrawSource(): void; /** * Deactivate all hs.draw interaction in map (Draw, Modify, Select) */ deactivateDrawing(): Promise; stopDrawing(): void; startDrawing(): void; /** * Repopulates drawable layers. In case layman connection exists it also creates * a list of available server possibilities. */ fillDrawableLayers(): Promise; private selectedLayerNotAvailable; keyUp(event: any): void; /** * Determines whether right-click should finish the drawing or not * @param typeNum - Number used in calculation of minimal number of vertexes. Depends on geom type (polygon/line) * @param vertexCount - Number of vertexes the sketch has * @returns return boolean value if right mouse button was clicked */ rightClickCondition(typeNum: number, vertexCount: number): boolean; /** * @param options - Options object * @param onDrawStart - Callback function called when drawing is started * @param onDrawEnd - Callback function called when drawing is finished * @param onSelected - Callback function called when feature is selected for modification * @param onDeselected - Callback function called when feature is deselected * @param changeStyle - controller callback function which set style * dynamically according to selected parameters * @param drawState - Should drawing be set active when * creating the interactions * Add drawing interaction to map. Partial interactions are Draw, Modify and Select. Add Event listeners for drawstart, drawend and (de)selection of feature. */ activateDrawing({ onDrawStart, onDrawEnd, onSelected, onDeselected, drawState, }: ActivateParams): Promise; /** * Register event handlers on draw interactions, so they can be unsubscribed after */ addHandler(e: EventsKey): void; /** * Add draw interaction on map and set some enhancements on it which don't depend on activateDrawing function */ setInteraction(interaction: Draw): Promise; /** * Syntactic sugar for translating */ private translate; /** * Display warning if symbolizer for current geometry being drawn is not present on layer */ private checkForMatchingSymbolizer; /** * Checks whether selected geometry can be properly visualized on selected layer */ hasRequiredSymbolizer(): boolean; /** * Handle snap interaction changes * Remove snap interaction if it already exists, recreate it if source is provided. */ toggleSnapping(source?: Vector): void; /** * Changes layer source of snap interaction */ changeSnapSource(layer: Vector$1>): void; /** * Selects or deselects all features in this.selectedLayer */ selectAllFeatures(): void; toggleBoxSelection(): void; /** * Remove one draw layer */ removeLayer(): Promise; /** * Remove multiple draw layers */ removeMultipleLayers(): Promise; /** * Remove draw layer/layers */ private layerRemoval; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } export { HsDrawService, TMP_LAYER_TITLE };