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 Default Description
hitTolerance number <optional>
5 Select tolerance in pixels.
features ol.Collection.<ol.Feature> <optional>
Destination for drawing.
source ol.source.Vector <optional>
Destination for drawing.
selectMoveOptions Object <optional>
Options for the select interaction used to move features.
selectModifyOptions Object <optional>
Options for the select interaction used to modify features.
moveInteractionOptions Object <optional>
Options for the move interaction.
modifyInteractionOptions Object <optional>
Options for the modify interaction.
deleteInteractionOptions Object <optional>
Options for the delete interaction.
deselectInteractionOptions Object <optional>
Options for the deselect interaction. Default: features are deselected on click on map.
Source:

Extends

Members

(private) className :string

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

(private) deleteInteraction :ol.interaction.Delete

Type:
  • ol.interaction.Delete
Source:

(private) deselectInteraction :ol.interaction.Interaction

Type:
  • ol.interaction.Interaction
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) getFeatureAtPixel :function

Return features elligible for selection on specific pixel.
Type:
  • function
Source:

(private) hitTolerance :number

Buffer around the coordintate clicked in pixels.
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 :ole.interaction.Move

Type:
  • ole.interaction.Move
Source:

(private) properties :object

Control properties.
Type:
  • object
Overrides:
Source:

(private) selectFilter :function

Filter function to determine which features are elligible for selection. By default we exclude features on unmanaged layers(for ex: nodes to delete).
Type:
  • function
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) addListeners(evt)

Add others listeners on the map than interactions.
Parameters:
Name Type Description
evt *
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) createDeleteInteraction(options)

Create the interaction used to delete selected features.
Parameters:
Name Type Description
options *
Source:

(private) createDeselectInteraction(options)

Create the interaction used to deselected features when we click on the map.
Parameters:
Name Type Description
options *
Source:

(private) createModifyInteraction(options)

Create the interaction used to modify vertexes of features.
Parameters:
Name Type Description
options *
Source:

(private) createMoveInteraction(options)

Create the interaction used to move feature.
Parameters:
Name Type Description
options *
Source:

(private) createSelectModifyInteraction(options)

Create the interaction used to select feature to modify.
Parameters:
Name Type Description
options *
Source:

(private) createSelectMoveInteraction(options)

Create the interaction used to select feature to move.
Parameters:
Name Type Description
options *
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:

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

getFeatureAtPixel(pixel)

Get a selectable feature at a pixel.
Parameters:
Name Type Description
pixel *
Source:

getProperties() → {object}

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

isHoverVertexFeatureAtPixel(pixel)

Detect if a vertex is hovered.
Parameters:
Name Type Description
pixel *
Source:

(private) onClick()

Click handler for the control element.
Overrides:
Source:

openDialog()

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

(private) removeListeners(evt)

Remove others listeners on the map than interactions.
Parameters:
Name Type Description
evt *
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: