ole
Version:
OpenLayers Editor
116 lines (115 loc) • 3.42 kB
TypeScript
export default Editor;
/**
* Core component of OLE.
* All controls are added to this class.
*/
declare class Editor {
/**
* Initialization of the editor.
* @param {ol.Map} map The map object.
* @param {Object} [options] Editor options.
* @param {Boolean} [options.showToolbar] Whether to show the toolbar.
* @param {HTMLElement} [options.target] Specify a target if you want
* the toolbar to be rendered outside of the map's viewport.
*/
constructor(map: ol.Map, opts: any);
/**
* @private
* @type {ol.Map}
*/
private map;
/**
* @private
* @type {ol.Collection<ole.Control>}
*/
private controls;
/**
* @private
* @type {ol.Collection<ole.Control>}
*/
private activeControls;
/**
* @private
* @type {ol.Collection<ole.Service>}
*/
private services;
/**
* @private
* @type {Object}
*/
private options;
/**
* Feature that is currently edited.
* @private
* @type {ol.Feature}
*/
private editFeature;
toolbar: Toolbar | undefined;
/**
* Controls use this function for triggering activity state changes.
* @param {ol.control.Control} control Control.
* @private
*/
private activeStateChange;
/**
* Adds a new control to the editor.
* @param {ole.Control} control The control.
*/
addControl(control: ole.Control): void;
/**
* Remove a control from the editor
* @param {ole.Control} control The control.
*/
removeControl(control: ole.Control): void;
/**
* Adds a service to the editor.
*/
addService(service: any): void;
/**
* Adds a collection of controls to the editor.
* @param {ol.Collection<ole.Control>} controls Collection of controls.
*/
addControls(controls: ol.Collection<ole.Control>): void;
/**
* Removes the editor from the map.
*/
remove(): void;
/**
* Returns a list of ctive controls.
* @returns {ol.Collection.<ole.Control>} Active controls.
*/
getControls(): ol.Collection<ole.Control>;
/**
* Returns a list of active controls.
* @returns {ol.Collection.<ole.Control>} Active controls.
*/
getActiveControls(): ol.Collection<ole.Control>;
/**
* Sets an instance of the feature that is edited.
* Some controls need information about the feature
* that is currently edited (e.g. for not snapping on them).
* @param {ol.Feature|null} feature The editfeature (or null if none)
* @protected
*/
protected setEditFeature(feature: ol.Feature | null): void;
/**
* Returns the feature that is currently edited.
* @returns {ol.Feature|null} The edit feature.
*/
getEditFeature(): ol.Feature | null;
/**
* Sets an instance of the feature that is being drawn.
* Some controls need information about the feature
* that is currently being drawn (e.g. for not snapping on them).
* @param {ol.Feature|null} feature The drawFeature (or null if none).
* @protected
*/
protected setDrawFeature(feature: ol.Feature | null): void;
drawFeature: any;
/**
* Returns the feature that is currently being drawn.
* @returns {ol.Feature|null} The drawFeature.
*/
getDrawFeature(): ol.Feature | null;
}
import Toolbar from './control/toolbar';