Handle that resizes a Bounds bounds shape.

This handle is linked to 1 corner of the bounds, based on its identifier.

The corner handles created by the BoundsEditor can flip, which changes their identifier. For example, if the one of the top corners is dragged below the bottom corners, the top and bottom handles flip their identifier.

See

BoundsEditor

Since

2022.1

Hierarchy

Constructors

Accessors

  • get active(): boolean
  • Indicates whether the handle is active.

    Returns boolean

  • set active(active): void
  • Parameters

    • active: boolean

    Returns void

  • get bounds(): Bounds
  • The bounds being edited by this handle

    Returns Bounds

  • get snapPoint(): null | Point
  • The point to snap to.

    This is used to paint a snap icon.

    Typically, this is set by subclasses, for example in PointDragHandle.drag.

    Returns null | Point

  • set snapPoint(p): void
  • Parameters

    Returns void

Methods

  • Called whenever the point is dragged to a new location.

    By default, this delegates to the drag function that was passed into the constructor.

    Parameters

    • point: Point

      The new location of the point, in model coordinates.

    • event: GestureEvent

      The gesture event that caused the drag.

    • context: EditContext

      The edit context

    Returns void

  • Called whenever the handle should flip its identifier.

    For example, if a horizontal flip occurred, and this handle was LOWER_LEFT, it should change its identifier to UPPER_LEFT.

    Parameters

    • flipHorizontal: boolean

      indicates whether it was a horizontal flip

    • flipVertical: boolean

      indicates whether it was a vertical flip

    Returns void

  • Returns the cursor for this point handle.

    • if the handle is active, this returns "grab".
    • if the handle is inactive, but the mouse interacts with the point, this returns "pointer".
    • otherwise, null is returned.

    Parameters

    Returns null | string

  • Returns the model point that this handle corresponds to.

    By default, this delegates to the getPoint function that was passed into the constructor.

    Returns Point

  • Checks whether the given input event interacts with the point handle.

    By default, this returns true if the mouse or finger is within a certain distance of the point. A larger distance is used for touch events than for mouse events.

    Parameters

    Returns boolean

  • 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

  • Transform a view point to model coordinates.

    The default implementation transforms the view point to a model coordinate on terrain. It also moves the point's Z to 0.

    Parameters

    • viewPoint: Point

      The view point to transform to model coordinates

    • context: EditContext

      The edit context

    Returns null | Point

    Since

    2023.1

Events

"Flipped" event

  • on("Flipped", callback: ((flippedVertical, flippedHorizontal) => void)) : Handle
  • An event that is fired whenever this handle has flipped while dragging. Flipped

    Parameters

    • event: "Flipped"
    • callback: ((flippedVertical, flippedHorizontal) => void)
        • (flippedVertical, flippedHorizontal): void
        • Parameters

          • flippedVertical: boolean
          • flippedHorizontal: boolean

          Returns void

    Returns Handle

"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