Class: Control

Control(options)

OLE control base class.

Constructor

new Control(options)

Parameters:
Name Type Description
options Object Control options.
Properties
Name Type Attributes Description
element HTMLElement Element which to substitute button. Set to null if you don't want to display an html element.
className string Name of the control's HTML class.
title string Title of the control toolbar button.
image Image Control toolbar image.
dialogTarget HTMLElement <optional>
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.
source ol.source.Vector <optional>
Vector source holding edit features. If undefined, options.features must be passed.
features ol.Collection.<ol.Feature> <optional>
Collection of edit features. If undefined, options.source must be set.
layerFilter function <optional>
Filter editable layer.
Source:

Extends

  • ol.control.Control

Members

(private) className :string

Html class name of the control button.
Type:
  • string
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
Source:

(private) editor :ole.Editor

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

(private) layerFilter :function

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

(private) properties :object

Control properties.
Type:
  • object
Source:

(private) source :ol.source.Vector

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

(private) standalone :Boolean

Type:
  • Boolean
Source:

(private) title :string

Control title.
Type:
  • string
Source:

Methods

activate()

Activate the control
Source:

(private) closeDialog()

Closes the control dialog.
Source:

deactivate(silentopt)

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

getActive() → {Boolean}

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

getElement() → {Element}

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

getProperties() → {object}

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

(private) onClick()

Click handler for the control element.
Source:

openDialog()

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

(protected) setEditor(editor)

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

(protected) setMap(map)

Sets the map of the control.
Parameters:
Name Type Description
map ol.Map The map object.
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.
Source: