ole
Version:
OpenLayers Editor
142 lines (141 loc) • 4.1 kB
TypeScript
export default Control;
/**
* OLE control base class.
* @extends ol.control.Control
* @alias ole.Control
*/
declare class Control {
/**
* @inheritdoc
* @param {Object} options Control options.
* @param {HTMLElement} options.element Element which to substitute button. Set to null if you don't want to display an html element.
* @param {string} options.className Name of the control's HTML class.
* @param {string} options.title Title of the control toolbar button.
* @param {Image} options.image Control toolbar image.
* @param {HTMLElement} [options.dialogTarget] Specify a target if you want
* the dialog div used by the control to be rendered outside of the map's viewport. Set tio null if you don't want to display the dialog of a control.
* @param {ol.source.Vector} [options.source] Vector source holding
* edit features. If undefined, options.features must be passed.
* @param {ol.Collection<ol.Feature>} [options.features] Collection of
* edit features. If undefined, options.source must be set.
* @param {function} [options.layerFilter] Filter editable layer.
*/
constructor(options: {
element: HTMLElement;
className: string;
title: string;
image: new (width?: number | undefined, height?: number | undefined) => HTMLImageElement;
dialogTarget?: HTMLElement | undefined;
source?: any;
features?: any;
layerFilter?: Function | undefined;
});
/**
* Specify a target if you want the dialog div used by the
* control to be rendered outside of the map's viewport.
* @type {HTMLElement}
* @private
*/
private dialogTarget;
/**
* Control properties.
* @type {object}
* @private
*/
private properties;
/**
* Html class name of the control button.
* @type {string}
* @private
*/
private className;
/**
* Control title.
* @type {string}
* @private
*/
private title;
/**
* Source with edit features.
* @type {ol.source.Vector}
* @private
*/
private source;
/**
* Filter editable layer. Used by select interactions instead of
* the old source property.
* @type {function}
* @private
*/
private layerFilter;
/**
* ole.Editor instance.
* @type {ole.Editor}
* @private
*/
private editor;
/**
* @type {Boolean}
* @private
*/
private standalone;
/**
* Returns the control's element.
* @returns {Element} the control element.
*/
getElement(): Element;
/**
* Click handler for the control element.
* @private
*/
private onClick;
/**
* Sets the map of the control.
* @protected
* @param {ol.Map} map The map object.
*/
protected setMap(map: ol.Map): void;
map: any;
/**
* Introduce the control to it's editor.
* @param {ole.Editor} editor OLE Editor.
* @protected
*/
protected setEditor(editor: ole.Editor): void;
/**
* Activate the control
*/
activate(silent: any): void;
active: boolean | undefined;
/**
* Dectivate the control
* @param {boolean} [silent] Do not trigger an event.
*/
deactivate(silent?: boolean | undefined): void;
/**
* Returns the active state of the control.
* @returns {Boolean} Active state.
*/
getActive(): boolean;
/**
* Open the control's dialog (if defined).
*/
openDialog(): void;
dialogDiv: HTMLDivElement | null | undefined;
/**
* Closes the control dialog.
* @private
*/
private closeDialog;
/**
* Set properties.
* @param {object} properties New control properties.
* @param {boolean} [silent] If true, no propertychange event is triggered.
*/
setProperties(properties: object, silent?: boolean | undefined): void;
/**
* Return properties.
* @returns {object} Copy of control properties.
*/
getProperties(): object;
}