geoview-core
    Preparing search index...

    Class OLTransform

    OpenLayers Transform interaction OLTransform

    Hierarchy

    • PointerInteraction
      • OLTransform
    Index

    Constructors

    • Initializes a OLTransform component.

      Parameters

      Returns OLTransform

    Properties

    angle: number = 0

    The angle for rotation

    center?: Coordinate

    The center of the feature being transformed

    currentHandle?: Feature<Geometry>

    The current handle being dragged

    disposed: boolean

    The object has already been disposed.

    features: Collection<Feature<Geometry>>

    The collection of features to transform

    handleLayer: VectorLayer<VectorSource<Feature<Geometry>>>

    The layer used to display handles

    handleSource: VectorSource

    The source for the handle layer

    handlingDownUpSequence: boolean
    mapViewer?: MapViewer

    The map viewer

    on: InteractionOnSignature<EventsKey>
    once: InteractionOnSignature<EventsKey>
    onDeletefeature?: (event: TransformDeleteFeatureEvent) => void
    onSelectionChange?: (event: TransformSelectionEvent) => void
    onTransformend?: (event: TransformEvent) => void
    onTransforming?: (event: TransformEvent) => void
    onTransformstart?: (event: TransformEvent) => void

    Callback functions for events

    Options for the transform interaction

    selectedFeature?: Feature<Geometry>

    The currently selected feature

    startCoordinate?: Coordinate

    The start coordinates when dragging

    startGeometry?: Geometry

    The start geometry when transforming

    targetPointers: PointerEvent[]
    un: InteractionOnSignature<void>

    Methods

    • Parameters

      • key: string

        Key name.

      • listener: Listener

        Listener.

      Returns void

    • Parameters

      • type: string

        Type.

      • listener: Listener

        Listener.

      Returns void

    • Protected

      Apply any properties from another object without triggering events.

      Parameters

      • source: BaseObject

        The source object.

      Returns void

    • Checks if redo is available.

      Returns boolean

      True if redo is available.

    • Checks if undo is available.

      Returns boolean

      True if undo is available.

    • Increases the revision counter and dispatches a 'change' event.

      Returns void

    • Clears all handles.

      Returns void

    • Clears the current selection.

      Parameters

      • keepHistory: boolean = false

        Whether the history should be kept when clearing the selection

      Returns void

    • Context menu event handler to prevent context menu when removing vertices

      Parameters

      • e: MouseEvent

      Returns void

    • Creates a delete handle for the feature.

      Parameters

      • extent: Extent

        The extent of the feature.

      Returns void

    • Creates the extent boundary rectangle.

      Parameters

      • extent: Extent

        The expanded extent.

      Returns void

    • Creates a handle at the specified coordinate with the given type.

      Parameters

      Returns void

    • Creates handles for the selected feature.

      Returns void

    • Creates a rotation handle above the feature.

      Parameters

      • extent: Extent

        The extent of the feature.

      Returns void

    • Creates scale handles at the corners of the extent.

      Parameters

      • extent: Extent

        The extent of the feature.

      Returns void

    • Creates stretch handles at the middle of each side of the extent.

      Parameters

      • extent: Extent

        The extent of the feature.

      Returns void

    • Creates vertex handles for LineString and Polygon geometries.

      Parameters

      • geometry: Polygon | LineString

        The geometry to create vertex handles for.

      Returns void

    • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

      Parameters

      • event: string | BaseEvent

        Event object.

      Returns boolean | undefined

      false if anyone called preventDefault on the event object or if any of the listeners returned false.

    • Cleans up the interaction.

      Returns void

    • Protected

      Extension point for disposable objects.

      Returns void

    • Gets a value.

      Parameters

      • key: string

        Key name.

      Returns any

      Value.

    • Return whether the interaction is currently active.

      Returns boolean

      true if the interaction is active, false otherwise.

    • Get a list of object property names.

      Returns string[]

      List of property names.

    • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

      Parameters

      • type: string

        Type.

      Returns Listener[] | undefined

      Listeners.

    • Get the map associated with this interaction.

      Returns Map | null

      Map.

    • Returns the current number of pointers involved in the interaction, e.g. 2 when two fingers are used.

      Returns number

      The number of pointers.

    • Get an object of all property names and values.

      Returns { [x: string]: any }

      Object.

    • Get an object of all property names and values.

      Returns { [x: string]: any } | null

      Object.

    • Get the version number for this object. Each time the object is modified, its version number will be incremented.

      Returns number

      Revision.

    • Gets the currently selected/transforming feature.

      Returns Feature<Geometry> | undefined

      The selected feature or undefined.

    • Handles adding a new vertex.

      Parameters

      • coordinate: Coordinate

        The coordinate for the new vertex.

      • OptionalmidpointHandle: Feature<Geometry>

        The midpoint handle being dragged.

      Returns void

    • Handle Click Events

      Parameters

      • event: MapBrowserEvent<PointerEvent>

        The map browser event.

      Returns boolean

      Whether the event was handled.

    • Handle pointer drag events.

      Parameters

      • event: MapBrowserEvent<PointerEvent>

        The map browser event.

      Returns void

    • Handle all events, including double-click

      Parameters

      • event: MapBrowserEvent<PointerEvent>

        The map browser event.

      Returns boolean

      Whether the event was handled.

    • Handle pointer move events. Not to be confused with moving handles. This overrides the move event from OL Pointer

      Parameters

      • event: MapBrowserEvent<PointerEvent>

        The map browser event.

      Returns void

    • Handles rotation of a feature.

      Parameters

      Returns void

    • Handles scaling of a feature.

      Parameters

      • coordinate: Coordinate

        The current coordinate.

      • handleType: HandleType

        The type of handle being dragged.

      • ctrlKey: boolean = false

        If the ctrlKey is being pressed to maintain the ratio

      Returns void

    • Handles stretching of a feature.

      Parameters

      • coordinate: Coordinate

        The current coordinate.

      • handleType: HandleType

        The type of handle being dragged.

      Returns void

    • Handles translation of a feature.

      Parameters

      • deltaX: number

        The change in X coordinate.

      • deltaY: number

        The change in Y coordinate.

      Returns void

    • Handle pointer up events.

      Parameters

      • event: MapBrowserEvent<PointerEvent>

        The map browser event.

      Returns boolean

      Whether the event was handled.

    • Handles moving a vertex.

      Parameters

      • coordinate: Coordinate

        The new coordinate.

      • OptionalvertexHandle: Feature<Geometry>

        The vertex handle being dragged.

      Returns void

    • Parameters

      • Optionaltype: string

        Type. If not provided, true will be returned if this event target has any listeners.

      Returns boolean

      Has listeners.

    • Returns boolean

      The object has properties.

    • Checks if a feature is currently being transformed.

      Parameters

      • feature: Feature

        The feature to check.

      Returns boolean

      True if the feature is being transformed.

    • Checks if any transformation is currently active.

      Returns boolean

      True if transformation is active.

    • Parameters

      • key: string

        Key name.

      • oldValue: any

        Old value.

      Returns void

    • Protected

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns EventsKey | EventsKey[]

      Event key.

    • Handles when a feature is removed from the collection.

      Parameters

      • event: { element: Feature }

        The event.

      Returns void

    • Protected

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns EventsKey | EventsKey[]

      Event key.

    • Redoes the next transformation.

      Parameters

      • Optionalcallback: () => void

      Returns boolean

      True if redo was successful.

    • Parameters

      • key: string

        Key name.

      • listener: Listener

        Listener.

      Returns void

    • Parameters

      • type: string

        Type.

      • listener: Listener

        Listener.

      Returns void

    • Selects a feature for transformation.

      Parameters

      • feature: Feature<Geometry>

        The feature to select.

      • clearHistory: boolean = true

        Whether to clear the history.

      Returns void

    • Sets a value.

      Parameters

      • key: string

        Key name.

      • value: any

        Value.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Activate or deactivate the interaction.

      Parameters

      • active: boolean

        Active.

      Returns void

    • Remove the interaction from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.

      Parameters

      • map: Map | null

        Map.

      Returns void

    • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

      Parameters

      • values: { [x: string]: any }

        Values.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Creates a simple text editor for text features

      Returns void

    • This function is used to determine if "down" events should be propagated to other interactions or should be stopped.

      Parameters

      • handled: boolean

        Was the event handled by the interaction?

      Returns boolean

      Should the down event be stopped?

    • Undoes the last transformation.

      Parameters

      • Optionalcallback: () => void

      Returns boolean

      True if undo was successful.

    • Protected

      Unlisten for a certain type of event.

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns void

    • Unsets a property.

      Parameters

      • key: string

        Key name.

      • Optionalsilent: boolean

        Unset without triggering an event.

      Returns void

    • Updates the handles to match the new geometry.

      Returns void

    • Gets the cursor style for a handle type.

      Parameters

      Returns string

      The cursor style.

    • Gets the event type from a handle type.

      Parameters

      • handleType: HandleType

        The handle type.

      • suffix: string

        The event suffix (start, ing, end).

      Returns string

      The event type.

    • Rotates a coordinate around a center point by an angle.

      Parameters

      • coordinate: Coordinate

        The coordinate to rotate.

      • center: Coordinate

        The center point.

      • angle: number

        The angle in radians.

      Returns Coordinate

      The rotated coordinate.

    • Scales a coordinate relative to a fixed point

      Parameters

      • coordinate: Coordinate

        The coordinate to scale.

      • fixedPoint: Coordinate

        The fixed point.

      • scaleX: number

        The X scale factor.

      • scaleY: number

        The Y scale factor.

      Returns Coordinate

      The scaled coordinate.