UNPKG

ole

Version:

OpenLayers Editor

167 lines (166 loc) 5.03 kB
export default ModifyControl; /** * Control for modifying geometries. * @extends {Control} * @alias ole.ModifyControl */ declare class ModifyControl extends Control { /** * @param {Object} [options] Tool options. * @param {number} [options.hitTolerance=5] Select tolerance in pixels. * @param {ol.Collection<ol.Feature>} [options.features] Destination for drawing. * @param {ol.source.Vector} [options.source] Destination for drawing. * @param {Object} [options.selectMoveOptions] Options for the select interaction used to move features. * @param {Object} [options.selectModifyOptions] Options for the select interaction used to modify features. * @param {Object} [options.moveInteractionOptions] Options for the move interaction. * @param {Object} [options.modifyInteractionOptions] Options for the modify interaction. * @param {Object} [options.deleteInteractionOptions] Options for the delete interaction. * @param {Object} [options.deselectInteractionOptions] Options for the deselect interaction. Default: features are deselected on click on map. * @param {Function} [options.cursorStyleHandler] Options to override default cursor styling behavior. */ constructor(options?: { hitTolerance?: number | undefined; features?: any; source?: any; selectMoveOptions?: any; selectModifyOptions?: any; moveInteractionOptions?: any; modifyInteractionOptions?: any; deleteInteractionOptions?: any; deselectInteractionOptions?: any; cursorStyleHandler?: Function | undefined; } | undefined); /** * Buffer around the coordintate clicked in pixels. * @type {number} * @private */ private hitTolerance; /** * Filter function to determine which features are elligible for selection. * By default we exclude features on unmanaged layers(for ex: nodes to delete). * @type {function(ol.Feature, ol.layer.Layer)} * @private */ private selectFilter; /** * Get a selectable feature at a pixel. * @param {*} pixel */ getFeatureAtPixel(pixel: any): any; previousCursor: any; cursorTimeout: any; cursorHandlerThrottled: any; cursorStyleHandler: Function; /** * Create the interaction used to select feature to move. * @param {*} options * @private */ private createSelectMoveInteraction; /** * Select interaction to move features. * @type {ol.interaction.Select} * @private */ private selectMove; /** * Create the interaction used to select feature to modify. * @param {*} options * @private */ private createSelectModifyInteraction; /** * Select interaction to modify features. * @type {ol.interaction.Select} */ selectModify: any; /** * Create the interaction used to move feature. * @param {*} options * @private */ private createMoveInteraction; /** * @type {ole.interaction.Move} * @private */ private moveInteraction; isMoving: boolean | undefined; /** * Create the interaction used to modify vertexes of features. * @param {*} options * @private */ private createModifyInteraction; /** * @type {ol.interaction.Modify} * @private */ private modifyInteraction; isModifying: boolean | undefined; /** * Create the interaction used to delete selected features. * @param {*} options * @private */ private createDeleteInteraction; /** * @type {ol.interaction.Delete} * @private */ private deleteInteraction; /** * Create the interaction used to deselected features when we click on the map. * @param {*} options * @private */ private createDeselectInteraction; /** * @type {ol.interaction.Interaction} * @private */ private deselectInteraction; /** * Detect if a vertex is hovered. * @param {*} pixel */ isHoverVertexFeatureAtPixel(pixel: any): boolean; isSelectedByMove(feature: any): boolean; isSelectedByModify(feature: any): boolean; /** * Handle the move event of the move interaction. * @param {ol.MapBrowserEvent} evt Event. * @private */ private cursorHandler; /** * Change cursor style. * @param {string} cursor New cursor name. * @private */ private changeCursor; setMap(map: any): void; /** * Add others listeners on the map than interactions. * @param {*} evt * @private */ private addListeners; cursorListenerKeys: any[] | undefined; /** * Remove others listeners on the map than interactions. * @param {*} evt * @private */ private removeListeners; /** * @inheritdoc */ activate(): void; /** * @inheritdoc */ deactivate(silent: any): void; } import Control from './control';