Class: TouchCursorModify

ol.interaction. TouchCursorModify

TouchCursor interaction + ModifyFeature


new TouchCursorModify(options, pixelTolerance)

Parameters:
Name Type Description
options olx.interaction.InteractionOptions

Options

Properties
Name Type Description
className string

cursor class name

coordinate ol.coordinate

cursor position

source ol.source.Vector

a source to modify (configured with useSpatialIndex set to true)

sources ol.source.Vector | Array.<ol.source.Vector>

a list of source to modify (configured with useSpatialIndex set to true)

features ol.Collection.<ol.Feature>

collection of feature to modify

filter function | undefined

a filter that takes a feature and return true if it can be modified, default always true.

pixelTolerance number

Pixel tolerance for considering the pointer close enough to a segment or vertex for editing, default 10

options.style ol.style.Style | Array.<ol.style.Style> | undefined

Style for the sketch features.

options.wrapX boolean

Wrap the world horizontally on the sketch overlay, default false

Extends

Methods


addButton(button)

Add a button element

Parameters:
Name Type Description
button *
options.className string

button class name

options.html DOMElement | string

button content

options.click function

onclick function

options.on *

an object with

options.before boolean
Inherited From:
Overrides:

addOverlay(ov)

Add an overlay to the interacton

Parameters:
Name Type Description
ov ol.Overlay
Inherited From:
Overrides:

getButtonElement(button)

Get cursor button element

Parameters:
Name Type Description
button string | number

the button className or the button index

Inherited From:
Overrides:
Returns:
Type
Element

getInteraction()

Get the modify interaction.


getOverlay()

Get cursor overlay

Inherited From:
Overrides:
Returns:
Type
ol.Overlay

getOverlayElement()

Get cursor overlay element

Inherited From:
Overrides:
Returns:
Type
Element

getPixel()

Get pixel position

Inherited From:
Overrides:
Returns:
Type
ol.pixel

getPosition()

Get the position of the target

Inherited From:
Overrides:
Returns:
Type
ol.coordinate

offsetPosition(coord)

Offset the target position

Parameters:
Name Type Description
coord ol.coordinate
Inherited From:
Overrides:

removeButton(button)

Remove a button element

Parameters:
Name Type Description
button string | number | undefined

the button className or the button index, if undefined remove all buttons, default remove all

Inherited From:
Overrides:
Returns:
Type
Element

removeOverlay(ov)

Remove an overlay from the interacton

Parameters:
Name Type Description
ov ol.Overlay
Inherited From:
Overrides:

setActive(active, position)

Activate or deactivate the interaction.

Parameters:
Name Type Description
active boolean

Active.

position ol.coordinate | null

position of the cursor (when activating), default viewport center.

Overrides:

setMap(map)

Remove the interaction from its current map, if any, and attach it to a new map, if any. Pass null to just remove the interaction from the current map.

Parameters:
Name Type Description
map _ol_Map_

Map.

Overrides:

setPosition(coord)

Set the position of the target

Parameters:
Name Type Description
coord ol.coordinate
Inherited From:
Overrides: