Creates a shape "by template".

After creation is started, the user clicks (or taps) once on the map to place the shape. The clicked (or tapped) point is passed into the applyTemplate function. That function moves the shape to the clicked point, and also changes its size so it fits the current view. You can use getDefaultSize and getDefaultPoint to easily determine an appropriate size and points for the shape.

Finally, the edit handles become active. When the user is done editing the shape (by double clicking outside the shape, or a single click if finishOnSingleClick), the creation finishes.

Since

2022.1

Hierarchy

Constructors

Accessors

  • set activeHandleIndex(index): void
  • The index of the active handle.

    Only relevant when cascading is false.

    -1 if no handle should be active.

    Parameters

    • index: number

    Returns void

  • get handles(): readonly EditHandle[]
  • The list of handles that this CompositeEditHandle delegates to.

    Note that the setter has side effects. Do not modify the list of handles in-place (e.g. push() new handles to the array after the setter has been called).

    Returns readonly EditHandle[]

  • set handles(handles): void
  • Parameters

    Returns void

Methods

Events

"EditShape" event

  • on("EditShape", callback: ((event) => void)) : Handle
  • An event that is emitted whenever this handle changes the shape of a feature.

    EditShape

    Parameters

    • event: "EditShape"
    • callback: ((event) => void)

    Returns Handle