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 (view full)

Constructors

Accessors

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

    Returns readonly EditHandle[]

  • get index(): number
  • The index of the currently active handle.

    Returns number

    Since

    2024.0

  • set index(val): void
  • Parameters

    • val: number

    Returns void

Methods

  • Invalidates this edit handle.

    This will cause onDraw and onDrawLabel to be called again.

    Use this if you need to update the visualization of the handle. For example, the handle has changed style and onDraw needs to be re-evaluated.

    Returns void

    Since

    2024.0.02

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

"Invalidated" event

  • on("Invalidated", callback: (() => void)) : Handle
  • An event that is emitted whenever this handle is invalidated.

    Invalidated

    Parameters

    • event: "Invalidated"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns Handle