Class: DrawControl

DrawControl(optionsopt)

Control for drawing features.

Constructor

new DrawControl(optionsopt)

Parameters:
Name Type Attributes Description
options Object <optional>
Tool options.
Properties
Name Type Attributes Description
type string <optional>
Geometry type ('Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon' or 'Circle'). Default is 'Point'.
drawInteractionOptions Object <optional>
Options for the Draw interaction (ol/interaction/Draw).
style ol.style.Style.StyleLike <optional>
Style used for the draw interaction.
Source:

Extends

Members

(private) className :string

Html class name of the control button.
Type:
  • string
Overrides:
Source:

(private) dialogTarget :HTMLElement

Specify a target if you want the dialog div used by the control to be rendered outside of the map's viewport.
Type:
  • HTMLElement
Overrides:
Source:

(private) drawInteraction :ol.interaction.Draw

Type:
  • ol.interaction.Draw
Source:

(private) editor :ole.Editor

ole.Editor instance.
Type:
  • ole.Editor
Overrides:
Source:

(private) layerFilter :function

Filter editable layer. Used by select interactions instead of the old source property.
Type:
  • function
Overrides:
Source:

(private) properties :object

Control properties.
Type:
  • object
Overrides:
Source:

(private) source :ol.source.Vector

Source with edit features.
Type:
  • ol.source.Vector
Overrides:
Source:

(private) standalone :Boolean

Type:
  • Boolean
Overrides:
Source:

(private) title :string

Control title.
Type:
  • string
Overrides:
Source:

Methods

activate()

Activate the control
Overrides:
Source:

(private) closeDialog()

Closes the control dialog.
Overrides:
Source:

deactivate(silentopt)

Dectivate the control
Parameters:
Name Type Attributes Description
silent boolean <optional>
Do not trigger an event.
Overrides:
Source:

getActive() → {Boolean}

Returns the active state of the control.
Overrides:
Source:
Returns:
Active state.
Type
Boolean

getElement() → {Element}

Returns the control's element.
Overrides:
Source:
Returns:
the control element.
Type
Element

getProperties() → {object}

Return properties.
Overrides:
Source:
Returns:
Copy of control properties.
Type
object

(private) onClick()

Click handler for the control element.
Overrides:
Source:

openDialog()

Open the control's dialog (if defined).
Overrides:
Source:

(protected) setEditor(editor)

Introduce the control to it's editor.
Parameters:
Name Type Description
editor ole.Editor OLE Editor.
Overrides:
Source:

(protected) setMap(map)

Sets the map of the control.
Parameters:
Name Type Description
map ol.Map The map object.
Overrides:
Source:

setProperties(properties, silentopt)

Set properties.
Parameters:
Name Type Attributes Description
properties object New control properties.
silent boolean <optional>
If true, no propertychange event is triggered.
Overrides:
Source: