Class: ModifyControl

ModifyControl(optionsopt)

Control for modifying geometries.

Constructor

new ModifyControl(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'.
hitTolerance number <optional>
Select tolerance in pixels (default is 5)
features ol.Collection.<ol.Feature> <optional>
Destination for drawing.
source ol.source.Vector <optional>
Destination for drawing.
selectMoveStyle ol.style.Style.StyleLike <optional>
Style used when a feature is selected to be moved.
selectModifyStyle ol.style.Style.StyleLike <optional>
Style used when a feature is selected to be modified.
modifyStyle ol.style.Style.StyleLike <optional>
Style used by the Modify interaction.
moveCondition ol.events.condition <optional>
Condition to trigger Move select.
modifyCondition ol.events.condition <optional>
Condition to trigger Modify select.
deleteCondition function <optional>
Function that takes a browser keyboard event, should return true to delete the current feature selected. (default deleteCondition activated on Backspace and Delete key)
Source:

Extends

Members

(private) className :string

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

(private) coordinate :ol.Coordinate

Type:
  • ol.Coordinate
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) editor :ole.Editor

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

(private) hitTolerance :number

Type:
  • number
Source:

(private) layerFilter :function

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

(private) modifyInteraction :ol.interaction.Modify

Type:
  • ol.interaction.Modify
Source:

(private) moveInteraction :ol.interaction.Pointer

Type:
  • ol.interaction.Pointer
Source:

(private) previousCursor :string

Type:
  • string
Source:

(private) properties :object

Control properties.
Type:
  • object
Overrides:
Source:

(private) selectModify :ol.interaction.Select

Select interaction to modify features
Type:
  • ol.interaction.Select
Source:

(private) selectMove :ol.interaction.Select

Select interaction to move features
Type:
  • ol.interaction.Select
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) changeCursor(cursor)

Change cursor style.
Parameters:
Name Type Description
cursor string New cursor name.
Source:

(private) closeDialog()

Closes the control dialog.
Overrides:
Source:

(private) cursorHandler(evt)

Handle the move event of the move interaction.
Parameters:
Name Type Description
evt ol.MapBrowserEvent Event.
Source:

deactivate(silentopt)

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

(private) deleteFeature(evt)

Handle the event of the delete event listener.
Parameters:
Name Type Description
evt Event Event.
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) moveFeature(evt)

Handle the drag event of the move interaction.
Parameters:
Name Type Description
evt ol.MapBrowserEvent Event.
Source:

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

(private) startMoveFeature(evt)

Handle the down event of the move interaction.
Parameters:
Name Type Description
evt ol.MapBrowserEvent Event.
Source:

(private) stopMoveFeature(evt)

Handle the up event of the pointer interaction.
Parameters:
Name Type Description
evt ol.MapBrowserEvent Event.
Source:

(private) unselectInteraction(evt)

Deselect features when editing geometries on a single click on map.
Parameters:
Name Type Description
evt ol.MapBrowserEvent Event.
Source: