Class: Editor

Editor(map, optionsopt)

Core component of OLE. All controls are added to this class.

Constructor

new Editor(map, optionsopt)

Initialization of the editor.
Parameters:
Name Type Attributes Description
map ol.Map The map object.
options Object <optional>
Editor options.
Properties
Name Type Attributes Description
showToolbar Boolean <optional>
Whether to show the toolbar. Default is true.
Source:

Members

(private) activeControls :ol.Collection.<ole.Control>

Type:
Source:

(private) controls :ol.Collection.<ole.Control>

Type:
Source:

(private) editFeature :ol.Feature

Feature that is currently edited.
Type:
  • ol.Feature
Source:

(private) map :ol.Map

Type:
  • ol.Map
Source:

(private) options :Object

Type:
  • Object
Source:

Methods

(private) activeStateChange(control)

Controls use this function for triggering activity state changes.
Parameters:
Name Type Description
control ol.control.Control Control.
Source:

addControl(control)

Adds a new control to the editor.
Parameters:
Name Type Description
control ole.Control The control.
Source:

addControls(controls)

Adds a collection of controls to the editor.
Parameters:
Name Type Description
controls ol.Collection.<ole.Control> Collection of controls.
Source:

getActiveControls() → {ol.Collection.<ole.Control>}

Returns a list of active controls.
Source:
Returns:
Active controls.
Type
ol.Collection.<ole.Control>

getEditFeature() → {ol.Feature|null}

Returns the feature that is currently edited.
Source:
Returns:
The edit feature.
Type
ol.Feature | null

remove()

Removes the editor from the map.
Source:

(protected) setEditFeature(feature)

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).
Parameters:
Name Type Description
feature ol.Feature | null The editfeature (or null if none)
Source: