Skip to content
Last updated

API / geotoolkit / controls / tools / LassoSelection / LassoSelection

Class: LassoSelection

tools.LassoSelection.LassoSelection

LassoSelection <br> <br> <h5>Events Events</h5> <table class="params"> <thead> <tr> <th>Event</th><th>Arguments</th><th>Description</th> </tr> </thead> <tbody> <tr> <td>onSelectionEnd</td> <td>LassoSelectionEventArgs</td> <td>This Event is fired when the Selection Tool select a visual. (similar to Selection.Events.onPick)</td> </tr> <tr> <td>onSelectionChanged</td> <td>LassoSelectionEventArgs</td> <td>This Event is fired when the Selection Tool select a visual and it is different from previous selection.</td> </tr> <tr> <td>beforeSelectionChange</td> <td>LassoSelectionEventArgs</td> <td>This Event is fired before the Selection Tool select a visual and it is different from previous selection.</td> </tr> <tbody> </table> <br>

Tool name: 'lasso-selection'

Hierarchy

Table of contents

Constructors
  • [new LassoSelection(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.lassoselection.lassoselection.md#new lassoselection(options))
Methods
Css Properties
Name Type Description
editmodeEditModePaint editor editing mode to determine which elements/features are allowed
editorOptionsThe extra editor properties to be provided for every new editor (see
editor-enabledbooleanEnabled state
editor-layerCompositeNodeManipulator layer
editor-layer-clippingbooleanEnable clipping, this does not consider the clipstyle, it is related to bounds-clipping
editor-layer-clipstyleClipStyleClipping style
editor-layer-clipstyle-evenoddbooleanTrue if evenodd mode is on (&#x27;nonzero&#x27; mode otherwise)
editor-layer-clipstyle-geometryGraphicsPathClipping geometry
editor-layer-clipstyle-geometry-boundsRectBounds
editor-layer-clipstyle-geometry-bounds-heightnumberHeight
editor-layer-clipstyle-geometry-bounds-readonlybooleanReadonly
editor-layer-clipstyle-geometry-bounds-widthnumberWidth
editor-layer-clipstyle-geometry-bounds-xnumberLeft
editor-layer-clipstyle-geometry-bounds-ynumberTop
editor-layer-clipstyleGraphicsPathClipping style
editor-layer-cssclassstringThe css class name of this node
editor-layer-csscursorstringCSS cursor associated with node
editor-layer-cssstylestringCSS style to be applied to inserted elements
editor-layer-idstring | numberId of the node, its a unique identifier
editor-layer-infinitybooleanMode to render outside the model limits
editor-layer-localtransformTransformationLocal transformation
editor-layer-localtransform-dxnumberX axis translation
editor-layer-localtransform-dynumberY axis translation
editor-layer-localtransform-xxnumberX scale
editor-layer-localtransform-xynumberXy skew
editor-layer-localtransform-yxnumberYx skew
editor-layer-localtransform-yynumberY scale
editor-layer-marginsnumber | stringIt has properties for specifying the margins for each side
editor-layer-namestringName of the node. It is often used for debugging purposes or to simplify queries
editor-layer-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
editor-layer-opacityblendmodeBlendModeNode opacity mode to blend it
editor-layer-scalescrollstrategyScaleScrollStrategyScale scroll strategy
editor-layer-scalescrollstrategy-enabledbooleanEnable flag
editor-layer-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
editor-layer-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
editor-layer-transformstringAdditional CSS transformation applied to node or &#x27;none&#x27;
editor-layer-transformTransformationAdditional CSS transformation applied to node or &#x27;none&#x27;
editor-layer-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
editor-layer-z-indexnumberDefine node z-index
editor-mouseradiusnumberDevice radius for mouse events
editor-namestringName of the tool used like cross-hair etc
editor-touchradiusnumberDevice radius for touch events
editorOptionsThe extra editor properties to be provided for every new editor (see
editor-bboxPathBounding box path to draw bounding rectangle OR bounding box path properties (see
editor-bbox-boundsRectBounds
editor-bbox-clipstyleClipStyleClipping style
editor-bbox-clipstyleGraphicsPathClipping style
editor-bbox-cssclassstringThe css class name of this node
editor-bbox-csscursorstringCSS cursor associated with node
editor-bbox-cssstylestringCSS style to be applied to inserted elements
editor-bbox-fillstylestringStyle applied on fill
editor-bbox-fillstyleFillStyleStyle applied on fill
editor-bbox-fillstyle-colorstringColor in CSS form
editor-bbox-fillstyle-evenoddmodebooleanEven-odd fill mode
editor-bbox-fillstyle-fillpatternPatternPattern
editor-bbox-fillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
editor-bbox-fillstyle-fillpattern-patternnamestringName of this pattern for indexing
editor-bbox-fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
editor-bbox-fillstyle-foregroundstringForeground color
editor-bbox-fillstyle-patternPatternPattern
editor-bbox-geometryGraphicsPathGeometry the path
editor-bbox-idstring | numberId of the node, its a unique identifier
editor-bbox-linestylestringStyle applied on outline
editor-bbox-linestyleLineStyleStyle applied on outline
editor-bbox-linestyle-colorstringColor in CSS form
editor-bbox-linestyle-fillstringOptional fill style to be used to fill lines generated with this style
editor-bbox-linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
editor-bbox-linestyle-linecapCapStyleThe line cap style
editor-bbox-linestyle-linedashoffsetnumberLine dash offset of dashed line
editor-bbox-linestyle-linejoinJoinStyleThe line join style
editor-bbox-linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
editor-bbox-linestyle-scalablebooleanTrue if width should depend on transformation
editor-bbox-linestyle-unitstringOptional unit for the width
editor-bbox-linestyle-widthnumber | stringThe line thickness
editor-bbox-localtransformTransformationLocal transformation
editor-bbox-marginsnumber | stringIt has properties for specifying the margins for each side
editor-bbox-namestringName of the node. It is often used for debugging purposes or to simplify queries
editor-bbox-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
editor-bbox-opacityblendmodeBlendModeNode opacity mode to blend it
editor-bbox-scalescrollstrategyScaleScrollStrategyScale scroll strategy
editor-bbox-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
editor-bbox-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
editor-bbox-transformstringAdditional CSS transformation applied to node or &#x27;none&#x27;
editor-bbox-transformTransformationAdditional CSS transformation applied to node or &#x27;none&#x27;
editor-bbox-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
editor-bbox-z-indexnumberDefine node z-index
editor-editmodeEditModeNode edit mode
editor-ghostOptionsOptions for
editor-ghost-cssclassstringThe css class name of this node
editor-ghost-idstring | numberId of the node, its a unique identifier
editor-ghost-namestringName of the node. It is often used for debugging purposes or to simplify queries
editor-ghost-selectablebooleanSelectable node, a boolean to determine if selection should consider this node
editor-ghost-taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
editor-ghost-visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
editor-ghost-z-indexnumberDefine node z-index
editor-ghostGhostOptionsOptions for
editor-ghost-fillstylestringGhost fill style
editor-ghost-fillstyleFillStyleGhost fill style
editor-ghost-linestylestringGhost line style
editor-ghost-linestyleLineStyleGhost line style
editor-ghost-opacitynumberGhost opacity from 0 to 1
editor-handlesHandlesOptionsHandles properties
editor-handles-bboxOptionsBbox resize handles properties (see
editor-handles-bboxOptionsBbox resize handles properties (see
editor-handles-bbox-clipstyleClipStyleClipping style
editor-handles-bbox-clipstyleGraphicsPathClipping style
editor-handles-bbox-csscursorstringCSS cursor associated with node
editor-handles-bbox-cssstylestringCSS style to be applied to inserted elements
editor-handles-bbox-localtransformTransformationLocal transformation
editor-handles-bbox-marginsnumber | stringIt has properties for specifying the margins for each side
editor-handles-bbox-opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
editor-handles-bbox-opacityblendmodeBlendModeNode opacity mode to blend it
editor-handles-bbox-scalescrollstrategyScaleScrollStrategyScale scroll strategy
editor-handles-bbox-transformstringAdditional CSS transformation applied to node or &#x27;none&#x27;
editor-handles-bbox-transformTransformationAdditional CSS transformation applied to node or &#x27;none&#x27;
editor-handles-bboxOptionsBbox resize handles properties (see
editor-handles-bbox-fillstylestringStyle applied on fill
editor-handles-bbox-fillstyleFillStyleStyle applied on fill
editor-handles-bbox-linestylestringStyle applied on outline
editor-handles-bbox-linestyleLineStyleStyle applied on outline
editor-handles-bboxOptionsBbox resize handles properties (see
editor-handles-bbox-alignmentAnchorTypeAlignment according to the anchor point
editor-handles-bbox-axnumberAnchor x position
editor-handles-bbox-aynumberAnchor y position
editor-handles-bbox-heightnumberShape height
editor-handles-bbox-ispointingupbooleanDefines whether the shape is always pointing up
editor-handles-bbox-layoutstyleLayoutStyleLayout style to specify how to lay out shape
editor-handles-bbox-layoutstyle-constraintSizeConstraintLayout constrains
editor-handles-bbox-layoutstyle-flexgrownumberNumber specifying how much the item will grow relative to the rest of the items inside the same container
editor-handles-bbox-layoutstyle-flexshrinknumberNumber specifying how much the item will shrink relative to the rest of the items inside the same container
editor-handles-bbox-layoutstyle-floatstringFloat position
editor-handles-bbox-layoutstyle-positionstringLayout position
editor-handles-bbox-layoutstyle-sizenumber | stringLayout size
editor-handles-bbox-maxdimensionDimensionMaximum size for rendering
editor-handles-bbox-maxdimension-heightnumberHeight of dimension
editor-handles-bbox-maxdimension-widthnumberWidth of dimension or properties
editor-handles-bbox-mindimensionDimensionMinimum size for rendering
editor-handles-bbox-preserveaspectratiobooleanPreserve aspect ratio of the anchored shape
editor-handles-bbox-preservereadingorientationbooleanPreserve reading orientation for local transform
editor-handles-bbox-preserverightanglebooleanPreserve right angle for local transformation
editor-handles-bbox-rotationanglenumberRotation angle at anchor
editor-handles-bbox-sizeisindevicespacebooleanIs coordinate in device space
editor-handles-bbox-useminmaxdimensionsbooleanUse the min max dimensions to limit visual size
editor-handles-bbox-widthnumberShape width
editor-handles-bboxOptionsBbox resize handles properties (see
editor-handles-bbox-alignmentAnchorTypeAnchor type of symbol
editor-handles-bbox-cachebooleanSet it to true if you want to cache complex geometry to raster
editor-handles-bbox-painterstringA function with has parameters: symbol, box, context
editor-handles-bbox-painterpropertiesanySymbol&#x27;s painter&#x27;s properties
editor-handles-rotationOptionsRotation handle properties (see
editor-handles-rotationOptionsRotation handle properties (see
editor-handles-rotationOptionsRotation handle properties (see
editor-handles-rotationOptionsRotation handle properties (see
editor-handles-rotationOptionsRotation handle properties (see
enabledbooleanEnabled state
layerCompositeNodeManipulator layer
modePaintModePaint mode to determine which shape is currently creating
mouseradiusnumberDevice radius for mouse events
namestringName of the tool used like cross-hair etc
nodeOptionsOptions to be applied to the new shapes
touchradiusnumberDevice radius for touch events

Contents

Constructors

new LassoSelection(options)

• new LassoSelection(options?)

Parameters

Name Type Description
Optional optionsCompositeNode<Node&gt; | Optionsused to display temporary shapes or tool options

Overrides

AbstractShapeSelection.constructor

Methods

addListener

▸ addListener(eventName, listener): LassoSelection

add event listener. The listener receives the message when the system event happens.

Deprecated

since 4.0 use .on() instead. Note that 3 args callback should be used in subscription via .on(): (eventType, source, args)

Parameters

Name Type Description
eventNamestringevent name or unique event identifier
listenerFunctionthe event listener

Returns

LassoSelection

Inherited from

AbstractShapeSelection.addListener


canRedo

▸ canRedo(): boolean

Checks if there is command in history to redo

Returns

boolean

Inherited from

AbstractShapeSelection.canRedo


canUndo

▸ canUndo(): boolean

Checks if there is command in history to undo

Returns

boolean

Inherited from

AbstractShapeSelection.canUndo


captureMouseUp

▸ captureMouseUp(): void

listen to window mouse events in order to catch a mouse up action outside of the tool container DOM element. useful for example when you pan and release click outside of DOM element.

Returns

void

Inherited from

AbstractShapeSelection.captureMouseUp


clear

▸ clear(): LassoSelection

Clears scene from all the painting elements

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.clear


createEditor

▸ Protected createEditor(options): AbstractEditorBase<Node | Node[]&gt;

Returns editor to edit node with provided options

Throws

if supported editor was not found and default editor was not set

Parameters

Name Type Description
optionsRecord<string, any&gt;editor options

Returns

AbstractEditorBase<Node | Node[]&gt;

Inherited from

AbstractShapeSelection.createEditor


createShapeSelectionEventArgs

▸ Protected createShapeSelectionEventArgs(eventArgs, selection, coordinates): LassoSelectionEventArgs

Parameters

Name Type
eventArgsEventArgs
selection(Node | SelectedItem<any&gt;)[]
coordinatesObject
coordinates.xnumber[]
coordinates.ynumber[]

Returns

LassoSelectionEventArgs

Overrides

AbstractShapeSelection.createShapeSelectionEventArgs


dispose

▸ dispose(): void

Dispose tool.

Returns

void

Inherited from

AbstractShapeSelection.dispose


editNode

▸ editNode(node): LassoSelection

Starts editing the node provided

Parameters

Name Type Description
nodeNode | Node[]node to edit

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.editNode


execute

▸ execute(command): LassoSelection

Applies the specified command to the associated node and appends it to history

Parameters

Name Type Description
commandAbstractCommandthe command to execute

Returns

LassoSelection

Inherited from

AbstractShapeSelection.execute


fireEvent

▸ fireEvent(eventName, eventArgs?): void

This method is Protected. Fire an Event.

Deprecated

since 4.0 use .notify() instead. Note that 3 args callback should be used in subscription via .on()

Parameters

Name Type Description
eventNamestringevent name
Optional eventArgsanycontains info of the event

Returns

void

Inherited from

AbstractShapeSelection.fireEvent


getActiveShape

▸ getActiveShape(): Node

Returns currently edited shape. Relevant for EditMode.Ghost mode.

Returns

Node

Inherited from

AbstractShapeSelection.getActiveShape


getAllowIntersection

▸ getAllowIntersection(): boolean

Get allow intersection

Returns

boolean

will this select items that intersect

Inherited from

AbstractShapeSelection.getAllowIntersection


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractShapeSelection.getClassName


getEditMode

▸ getEditMode(): EditMode

Returns tool current edit mode

Returns

EditMode

Inherited from

AbstractShapeSelection.getEditMode


getEditor

▸ getEditor(): Pencil

Returns current editor tool (if exists)

Returns

Pencil

Overrides

AbstractShapeSelection.getEditor


getEvenOddMode

▸ getEvenOddMode(): boolean

Get even odd mode

Returns

boolean

will this use even odd mode or not

Inherited from

AbstractShapeSelection.getEvenOddMode


getEventRadius

▸ Protected getEventRadius(eventArgs): number

Returns device radius for the provided event

Parameters

Name Type Description
eventArgsEventArgscontains info of the event

Returns

number

Inherited from

AbstractShapeSelection.getEventRadius


getFillStyle

▸ getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fill style

Inherited from

AbstractShapeSelection.getFillStyle


getHistory

▸ getHistory(): History

Returns current history

Returns

History

Inherited from

AbstractShapeSelection.getHistory


getLineStyle

▸ getLineStyle(): LineStyle

Return line style

Returns

LineStyle

line style

Inherited from

AbstractShapeSelection.getLineStyle


getManipulatorLayer

▸ getManipulatorLayer(): CompositeNode<Node&gt;

return manipulator layer

Returns

CompositeNode<Node&gt;

layer

Inherited from

AbstractShapeSelection.getManipulatorLayer


getMode

▸ getMode(): PaintMode

Returns current painting mode

Returns

PaintMode

Inherited from

AbstractShapeSelection.getMode


getMouseRadius

▸ getMouseRadius(): number

Returns current device radius for mouse events

Returns

number

Inherited from

AbstractShapeSelection.getMouseRadius


getName

▸ getName(): string

return tool name if any

Returns

string

name of the tool

Inherited from

AbstractShapeSelection.getName


getParentTool

▸ getParentTool(): AbstractCompositeTool

Gets parent tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractShapeSelection.getParentTool


getProperties

▸ getProperties(): OptionsOut

Returns all properties

Returns

OptionsOut

tool options

Inherited from

AbstractShapeSelection.getProperties


getProperty

▸ getProperty(name): any

Gets dynamic property by name. These properties can be used as a property bags

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

AbstractShapeSelection.getProperty


getPropertyKeys

▸ getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

AbstractShapeSelection.getPropertyKeys


getRegistry

▸ Protected getRegistry(): Registry

Returns

Registry

Inherited from

AbstractShapeSelection.getRegistry


getRoot

▸ getRoot(): AbstractCompositeTool

Gets root tool

Returns

AbstractCompositeTool

parent tool

Inherited from

AbstractShapeSelection.getRoot


getSelection

▸ getSelection(): (Node | SelectedItem<any&gt;)[]

gets the currently selected items

Returns

(Node | SelectedItem<any&gt;)[]

Inherited from

AbstractShapeSelection.getSelection


getShape

▸ getShape(): Path

Returns the origin of currently edited shape (if exists, null otherwise).

Returns

Path

Overrides

AbstractShapeSelection.getShape


getTouchRadius

▸ getTouchRadius(): number

Returns current device radius for touch events

Returns

number

Inherited from

AbstractShapeSelection.getTouchRadius


hasEventListener

▸ hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

AbstractShapeSelection.hasEventListener


isActive

▸ isActive(): boolean

return active state

Returns

boolean

Inherited from

AbstractShapeSelection.isActive


isAutoDisabled

▸ isAutoDisabled(): boolean

Get auto-disabled mode

Returns

boolean

does the selection automatically disable itself on selection changed

Inherited from

AbstractShapeSelection.isAutoDisabled


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractShapeSelection.isDisposed


isDoubleClick

▸ Protected isDoubleClick(point, eventArgs?): boolean

returns true if double clicked

Parameters

Name Type Description
pointPointClick point
Optional eventArgsEventArgsoptional event args to verify double click

Returns

boolean

Inherited from

AbstractShapeSelection.isDoubleClick


isEnabled

▸ isEnabled(): boolean

returns enable state

Returns

boolean

state

Inherited from

AbstractShapeSelection.isEnabled


isSilent

▸ isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

AbstractShapeSelection.isSilent


isTouchEvent

▸ isTouchEvent(eventArgs): boolean

return true if the event is a touch event and false otherwise.

Parameters

Name Type Description
eventArgsEvent | EventArgscontains info of the event

Returns

boolean

Inherited from

AbstractShapeSelection.isTouchEvent


notify

▸ notify<E&gt;(type, source, args?): LassoSelection

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceLassoSelectionof the event
Optional argsEventMap[E]arguments of the event

Returns

LassoSelection

this

Overrides

AbstractShapeSelection.notify


off

▸ off<E&gt;(type?, callback?): LassoSelection

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: LassoSelection, args: EventMap[E]) => voidfunction to be called

Returns

LassoSelection

this

Overrides

AbstractShapeSelection.off


on

▸ on<E&gt;(type, callback): LassoSelection

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target. </p> TypeScript hint: in case of creating derived tool with own events, EventMap should be extended and .on() and .notify() methods redeclared, see sample.

Example

// Using in derived tool
import type {EventMap as EventMapBase} from '@int/geotoolkit/controls/tools/AbstractTool';
export type EventMap = EventMapBase &amp; {
&#91;MyToolEvents.onValueChanged&#93;: MyToolEventArgs
}
export enum MyToolEvents {
onValueChanged = 'onValueChanged'
}
export class MyTool extends AbstractTool {
public declare on: &lt;E extends keyof EventMap&gt;(type: E, callback: (eventType: E, sender: this, args: EventMap&#91;E&#93;) =&gt; void) =&gt; this;
protected declare notify: &lt;E extends keyof EventMap&gt;(type: E, source: AbstractTool, args?: EventMap&#91;E&#93;) =&gt; this;
public declare off: &lt;E extends keyof EventMap&gt;(type: E, callback?: (eventType: E, sender: this, args: EventMap&#91;E&#93;) =&gt; void) =&gt; this;
// ...
}

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: LassoSelection, args: EventMap[E]) => voidto be called

Returns

LassoSelection

Overrides

AbstractShapeSelection.on


onActiveStateChanged

▸ Protected onActiveStateChanged(): void

Fires

Events.onStateChanged

Returns

void

Inherited from

AbstractShapeSelection.onActiveStateChanged


onBeforeCommandApplying

▸ Protected onBeforeCommandApplying(eventName, history, command): void

Fires the EditEvents.BeforeCommandApplied event

Parameters

Name Type Description
eventNameEditEventsthe event name
historyHistorythe source history
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractShapeSelection.onBeforeCommandApplying


onCommandApplied

▸ Protected onCommandApplied(eventName, history, command): void

Fires the EditEvents.CommandApplied event and the event according to the command event name

Parameters

Name Type Description
eventNameEditEventsthe event name
historyHistorythe source history
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractShapeSelection.onCommandApplied


onCommandApplying

▸ Protected onCommandApplying(eventName, history, command): void

Fires the EditEvents.CommandApplying event

Parameters

Name Type Description
eventNameEditEventsthe event name
historyHistorythe source history
commandAbstractCommandthe command applied

Returns

void

Inherited from

AbstractShapeSelection.onCommandApplying


onCommandRedo

▸ Protected onCommandRedo(eventName, history, command): void

Fires the EditEvents.Redo event

Parameters

Name Type Description
eventNameEditEventsthe event name
historyHistorythe source history
commandAbstractCommandthe command

Returns

void

Inherited from

AbstractShapeSelection.onCommandRedo


onCommandUndo

▸ Protected onCommandUndo(eventName, history, command): void

Fires the EditEvents.Undo event

Parameters

Name Type Description
eventNameEditEventsthe event name
historyHistorythe source history
commandAbstractCommandthe command

Returns

void

Inherited from

AbstractShapeSelection.onCommandUndo


onEnabledStateChanged

▸ Protected onEnabledStateChanged(): void

Fires

Events.onEnabledStateChanged

Returns

void

Inherited from

AbstractShapeSelection.onEnabledStateChanged


onKeyDown

▸ Protected onKeyDown(eventArgs): void

Handles key down event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractShapeSelection.onKeyDown


onKeyUp

▸ Protected onKeyUp(eventArgs): void

Handles key up event

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractShapeSelection.onKeyUp


onMouseDown

▸ Protected onMouseDown(eventArgs): void

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractShapeSelection.onMouseDown


onMouseMove

▸ Protected onMouseMove(eventArgs): void

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractShapeSelection.onMouseMove


onMouseUp

▸ Protected onMouseUp(eventArgs): void

Parameters

Name Type Description
eventArgsEventArgsevent args

Returns

void

Inherited from

AbstractShapeSelection.onMouseUp


onNodeCreated

▸ Protected onNodeCreated(editor, eventArgs): void

Node created handler

Parameters

Name Type Description
editorAbstractEditorBase<Node | Node[]&gt;editor that created node
eventArgsPaintEventArgsevent args

Returns

void

Inherited from

AbstractShapeSelection.onNodeCreated


pageToCanvas

▸ pageToCanvas(eventArgs, externalPlot?): Object

return position relative to the canvas

Parameters

Name Type Description
eventArgsEvent | EventArgsparentElement the parent HTML element
Optional externalPlotPlotplot

Returns

Object

NameType
xnumber
ynumber

Inherited from

AbstractShapeSelection.pageToCanvas


pointToModel

▸ pointToModel(model, eventArgs): Point

converts device coordinates to inner coordinates of node

Parameters

Name Type Description
modelNodethe model
eventArgsPoint | EventArgsarguments of the event OR point in device (plot) coordinates.

Returns

Point

Inherited from

AbstractShapeSelection.pointToModel


redo

▸ redo(): LassoSelection

Reapplies last canceled command in history (if possible)

Returns

LassoSelection

Inherited from

AbstractShapeSelection.redo


removeListener

▸ removeListener(eventName, listener?): LassoSelection

remove event listener. The listener reveives the message when the system event happens.

Deprecated

since 4.0 use .off() instead.

Parameters

Name Type Description
eventNamestringevent name
Optional listenerFunction | Function[]the event listener, if null, remove all listeners for the event

Returns

LassoSelection

Inherited from

AbstractShapeSelection.removeListener


selection

▸ Protected selection(root, x, y, eventArgs): LassoSelection

starts the selection process

Parameters

Name Type Description
rootNoderoot node to select from
xnumber[]x-coordinates
ynumber[]y-coordinates
eventArgsPaintEventArgsevent args

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.selection


setActive

▸ setActive(active): LassoSelection

set active state

Fires

Events.onStateChanged

Parameters

Name Type Description
activebooleanset active state

Returns

LassoSelection

Inherited from

AbstractShapeSelection.setActive


setAllowIntersection

▸ setAllowIntersection(mode): LassoSelection

Set allow intersection

Parameters

Name Type Description
modebooleanwill this select items that intersect

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setAllowIntersection


setAutoDisabled

▸ setAutoDisabled(mode): LassoSelection

Set auto-disabled mode

Parameters

Name Type Description
modebooleandoes the selection automatically disable itself on selection changed

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setAutoDisabled


setEditMode

▸ setEditMode(mode): LassoSelection

Sets tool edit mode (for nodes with node manipulators)

Parameters

Name Type Description
modeEditModeedit mode

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setEditMode


setEditor

▸ Protected setEditor(editor): LassoSelection

Sets a new editor

Throws

Error if editor is not instance of Pencil

Parameters

Name Type Description
editorAbstractEditorBase<Node | Node[]&gt;the editor

Returns

LassoSelection

Overrides

AbstractShapeSelection.setEditor


setEnabled

▸ setEnabled(enabled): LassoSelection

set enable state

Fires

Events.onEnabledStateChanged

Fires

Events.onStateChanged

Parameters

Name Type Description
enabledbooleansets the enabled state

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setEnabled


setEvenOddMode

▸ setEvenOddMode(mode): LassoSelection

Set even odd mode

Parameters

Name Type Description
modebooleaneven odd mode

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setEvenOddMode


setFillStyle

▸ setFillStyle(fillStyle, merge?): LassoSelection

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setFillStyle


setLineStyle

▸ setLineStyle(fillStyle, merge?): LassoSelection

Sets line style

Parameters

Name Type Description
fillStyleType
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setLineStyle


setMode

▸ setMode(mode): LassoSelection

Sets painting mode

Parameters

Name Type Description
modePaintModepainting mode

Returns

LassoSelection

Inherited from

AbstractShapeSelection.setMode


setMouseRadius

▸ setMouseRadius(radius): LassoSelection

Sets device radius for mouse events

Parameters

Name Type Description
radiusnumberradius for mouse events

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setMouseRadius


setName

▸ setName(name): LassoSelection

set tool name

Parameters

Name Type Description
namestringthe tool name

Returns

LassoSelection

Inherited from

AbstractShapeSelection.setName


setNodeFilter

▸ setNodeFilter(filter): LassoSelection

set filter handler

Parameters

Name Type Description
filterNodeFilterCallbackThis allows to filter selected nodes.

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setNodeFilter


setProperties

▸ setProperties(props?): LassoSelection

Sets paint tool properties (mode, styles, etc.)

Parameters

Name Type Description
Optional propsOptionstool props

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setProperties


setProperty

▸ setProperty(name, value): LassoSelection

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setProperty


setSilent

▸ setSilent(bool): LassoSelection

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setSilent


setSlotEnabled

▸ setSlotEnabled(eventName, value, target?): LassoSelection

Sets slot enabled

Parameters

Name Type Description
eventNamestringeventName
valuebooleanvalue
Optional targetEventTargettarget

Returns

LassoSelection

Inherited from

AbstractShapeSelection.setSlotEnabled


setSlots

▸ setSlots(slots?, merge?): LassoSelection

Sets new slots.

Example

const slots = {
'pointerdown': (event: EventArgs) =&gt; {
// event is an instance of @int/geotoolkit/controls/tools/EventArgs
...
}
};
tool.setSlots(slots);

Parameters

Name Type Description
Optional slotsRecord<string, Slot | Slot[] | (eventArgs: EventArgs) => void&gt;type of system events
Optional mergebooleanset to true if you want to merge with existing slots

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setSlots


setTouchRadius

▸ setTouchRadius(radius): LassoSelection

Sets device radius for touch events

Parameters

Name Type Description
radiusnumberradius for touch events

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.setTouchRadius


start

▸ Protected start(eventArgs?): LassoSelection

start

Parameters

Name Type Description
Optional eventArgsEventArgsevent args

Returns

LassoSelection

Inherited from

AbstractShapeSelection.start


stop

▸ Protected stop(): LassoSelection

stop

Returns

LassoSelection

Inherited from

AbstractShapeSelection.stop


toggle

▸ toggle(): LassoSelection

switch enable state to opposite state

Returns

LassoSelection

Inherited from

AbstractShapeSelection.toggle


undo

▸ undo(): LassoSelection

Cancels last command in history (if possible)

Returns

LassoSelection

Inherited from

AbstractShapeSelection.undo


update

▸ update(): LassoSelection

Forces editing shapes and handles to be updated

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.update


updateHandles

▸ updateHandles(): LassoSelection

Forces editing handles to be synchronized with shape

Returns

LassoSelection

this

Inherited from

AbstractShapeSelection.updateHandles


canvasToClient

▸ Static canvasToClient(plotPoint, plot): Point

Convert plot coordinates to global coordinates

Parameters

Name Type Description
plotPointPointpoint in plot coordinates
plotPlotplot with canvas

Returns

Point

Inherited from

AbstractShapeSelection.canvasToClient


clientToCanvas

▸ Static clientToCanvas(nativeEvent, plot): Point

Convert global coordinates to plot coordinates

Parameters

Name Type Description
nativeEventEventnative browser event
plotPlotplot with canvas

Returns

Point

Inherited from

AbstractShapeSelection.clientToCanvas


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractShapeSelection.getClassName


getExclusiveTool

▸ Static getExclusiveTool(plot): AbstractTool

return exclusive tool associated with plot

Parameters

Name Type Description
plotPlotplot

Returns

AbstractTool

tool

Inherited from

AbstractShapeSelection.getExclusiveTool


getNativeEventName

▸ Static getNativeEventName(eventName): string[]

Returns native event name

Parameters

Name Type Description
eventNamestringW3C Pointer Events Recommendation name

Returns

string[]

Inherited from

AbstractShapeSelection.getNativeEventName


isTouchEvent

▸ Static isTouchEvent(eventArgs): eventArgs is TouchEvent

return true if the event is a touch event and false otherwise.

Parameters

Name Type Description
eventArgsEvent | EventArgscontains info of the event

Returns

eventArgs is TouchEvent

Inherited from

AbstractShapeSelection.isTouchEvent


lock

▸ Static lock(plot, tool): void

Set exclusive tool for plot

Parameters

Name Type Description
plotPlotplot
toolAbstractTooltool

Returns

void

Inherited from

AbstractShapeSelection.lock


setDefaultMouseRadius

▸ Static setDefaultMouseRadius(radius): void

Sets default device radius for mouse events

Parameters

Name Type Description
radiusnumberradius for mouse events

Returns

void

Inherited from

AbstractShapeSelection.setDefaultMouseRadius


setDefaultTouchRadius

▸ Static setDefaultTouchRadius(radius): void

Sets default device radius for touch events

Parameters

Name Type Description
radiusnumberradius for touch events

Returns

void

Inherited from

AbstractShapeSelection.setDefaultTouchRadius


unlock

▸ Static unlock(value): void

Remove exclusive tool from plot

Parameters

Name Type Description
valueAbstractTool | Plotvalue

Returns

void

Inherited from

AbstractShapeSelection.unlock