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.
target HTMLElement <optional>
Specify a target if you want the toolbar to be rendered outside of the map's viewport.
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:

(private) services :ol.Collection.<ole.Service>

Type:
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:

addService()

Adds a service to the editor.
Source:

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

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

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

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

getDrawFeature() → {ol.Feature|null}

Returns the feature that is currently being drawn.
Source:
Returns:
The drawFeature.
Type
ol.Feature | null

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:

removeControl(control)

Remove a control from the editor
Parameters:
Name Type Description
control ole.Control The control.
Source:

(protected) setDrawFeature(feature)

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