Skip to content
Last updated

API / geotoolkit / controls / tools / editors / commands / addpoint / AddPoint

Class: AddPoint

commands.addpoint.AddPoint

Command of adding a new point to the node

Hierarchy

Table of contents

Constructors
  • [new AddPoint(point, index, isInsert)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.editors.commands.addpoint.addpoint.md#new addpoint(point, index, isinsert))
Methods

Contents

Constructors

new AddPoint(point, index, isInsert)

• new AddPoint(point, index, isInsert?)

Parameters

Name Type Description
pointPointpoint to be added
indexnumberposition of the point to be added
Optional isInsertbooleantrue if new point should be inserted, false otherwise

Overrides

AbstractCommand.constructor

Methods

createInverse

▸ createInverse(): AbstractCommand

Returns inverse command

Returns

AbstractCommand

Inherited from

AbstractCommand.createInverse


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractCommand.getClassName


getEventName

▸ getEventName(): string

Returns event to be fired when command is applied

Returns

string

Inherited from

AbstractCommand.getEventName


getIndex

▸ getIndex(): number

Returns new point index position

Returns

number


getNode

▸ getNode(): Node | Node[]

Returns target command node

Returns

Node | Node[]

Inherited from

AbstractCommand.getNode


getOptions

▸ getOptions(): Record<string, any&gt;

Returns command options

Returns

Record<string, any&gt;

Inherited from

AbstractCommand.getOptions


getPoint

▸ getPoint(): Point

Returns new point

Returns

Point


getX

▸ getX(): number

Returns new point x-ordinate

Returns

number


getY

▸ getY(): number

Returns new point y-ordinate

Returns

number


isInsert

▸ isInsert(): boolean

Returns true if new point should be inserted, false otherwise

Returns

boolean


isRejected

▸ isRejected(): boolean

Returns rejected state

Returns

boolean

the state

Inherited from

AbstractCommand.isRejected


isSeparate

▸ isSeparate(): boolean

Returns true if command is separate, false otherwise

Returns

boolean

Inherited from

AbstractCommand.isSeparate


merge

▸ merge(command): boolean

Tries to merge current with another command. If successful, return true and second command won't be stored in history. Returns false otherwise.

Parameters

Name Type Description
commandAbstractCommandcommand to merge

Returns

boolean

Inherited from

AbstractCommand.merge


reject

▸ reject(): AddPoint

Rejects action

Returns

AddPoint

this

Inherited from

AbstractCommand.reject


setNode

▸ setNode(node): AddPoint

Sets target node for the command

Parameters

Name Type Description
nodeNode | Node[]node(s) for applying the command

Returns

AddPoint

this

Inherited from

AbstractCommand.setNode


setOptions

▸ setOptions(options): AddPoint

Sets extra options to be stored in command

Parameters

Name Type Description
optionsRecord<string, any&gt;some extra options for the command to store

Returns

AddPoint

this

Inherited from

AbstractCommand.setOptions


setSeparate

▸ setSeparate(isSeparate): AddPoint

Sets command to be separate or not (true by default). Not separate commands are ignored by history undo/redo actions and considered as a part of the last separate command.

Parameters

Name Type Description
isSeparatebooleantrue if command should be considered as a separate operation (in undo/redo history), false otherwise

Returns

AddPoint

this

Inherited from

AbstractCommand.setSeparate


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractCommand.getClassName