Options
All
  • Public
  • Public/Protected
  • All
Menu

An edit handle manipulates a feature or some part of that feature, usually its shape, based on input from the user.

Edit handles are created by an Editor whenever an EditController or CreateController becomes active on the map.

Edit handles generally correspond to the shape of the feature being edited. For example, to edit a four-sided polygon, an Editor creates five handles: four to move each of the individual vertices of the polygon, and a fifth one to move the polygon as a whole.

For more information, check out the Customizing creation and editing guide.

since

2022.1

Hierarchy

Overview

Constructors

constructor

Events

on

  • An event that is emitted whenever this handle changes the shape of a feature.

    Parameters

    Returns Handle

Accessors

Protected eventedSupport

Methods

Protected emitEditShapeEvent

  • Emits an "EditShape" event.

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

    Parameters

    Returns void

getCursor

  • Returns the mouse cursor to show.

    EditController and CreateController will check the active handle's cursor on every onGestureEvent, and update the map's cursor when the returned cursor string changes.

    The default implementation always returns null.

    Parameters

    Returns string | null

    a cursor, or null if no mouse cursor should be shown for this handle.

onCreateContextMenu

  • 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

onDraw

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

    For example, a point handle draws an icon at its point using EditHandleStyles.handleIconStyle.

    A handle can also draw "helper" shapes. These are shapes that are not interactive, but help the user while editing. For example, the base shape of an extruded shape, draped over terrain. Or lines showing how a point can move.

    For consistency with built-in handles, it's recommended to draw helper shapes using EditHandleStyles.helperStyle and icons using EditHandleStyles.handleIconStyle.

    The default implementation draws nothing.

    Parameters

    Returns void

onDrawLabel

  • 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

onGestureEvent

update

  • (): 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.

    see

    EditHandle.on

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method