A handle to create point list shapes, ie. polygons and polylines.

It supports creation of point lists for both mouse and touch input. The user can click (or tap) on the map to add points to the pointlist. Once placed, the points cannot be moved or removed by this handle.

If freehand is true, the user can start dragging the mouse near the last created point to start "freehand" drawing. While "freehand" drawing is active, points are inserted automatically under the mouse / finger.

See

PointListEditor

Since

2022.1

Hierarchy

Constructors

Accessors

Methods

  • Emits an "EditShape" event.

    Typically, a handle emits this right after changing the shape.

    Parameters

    Returns void

  • Returns the current cursor for this handle.

    The default implementation always returns "crosshair".

    Parameters

    Returns string

  • Populates a context menu with entries.

    For example, a handle for a point in a polyline might add a "Delete point" context menu entry.

    Parameters

    • event: GestureEvent

      the input event that triggered opening the context menu.

    • context: EditContext

      the edit context

    • contextMenu: ContextMenu

      the context menu to add entries to.

    • onDone: (() => void)

      a callback that needs to be called when a menu action is performed. Call this at the end of the ContextMenuItem.action implementation.

        • (): void
        • Returns void

    Returns void

  • This method allows the handle to draw labels on the map.

    For example, you can use this to show coordinates of points, or the current radius of a circle on top of an edit handle.

    The default implementation draws nothing.

    Parameters

    Returns void

  • Called when (another) handle changes the feature or shape, as indicated by the "EditShape" event.

    This handle can update its own state, based on the changed shape.

    For example, a PointListInsertHandle just inserted a point in a polyline. The PointListTranslateHandle uses the update to recalculate new sub-handles, based on the new polyline (with the extra point).

    The default implementation does nothing.

    Returns void

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