Options
All
  • Public
  • Public/Protected
  • All
Menu

A controller that handles all events. This can be used to block events from going down the controller chain when used in a CompositeController, or to prevent default map behavior.

See the Managing user input with LuciadRIA controllers tutorial for more information.

since

2022.1

Hierarchy

Implements

Overview

Constructors

constructor

Events

on

  • (event: "Activated", callback: (map: Map) => void, context?: any): Handle
  • (event: "Deactivated", callback: (map: Map) => void, context?: any): Handle
  • (event: "Invalidated", callback: () => void, context?: any): Handle
  • An event indicating that this Controller has been activated. Activated means that the controller is active on the map, and the controller's onActivate has been called.

    You can use this event to set up UI elements or other listeners related to the controller and the controller's map.

    since

    2021.0

    Parameters

    • event: "Activated"
    • callback: (map: Map) => void
        • (map: Map): void
        • Parameters

          Returns void

    • Optional context: any

    Returns Handle

  • An event indicating that this Controller has been deactivated. Deactivated means that the controller has been removed from the map, and the controller's onDeactivate has been called.

    You can use this event to clean up UI elements or other listeners related to the controller and the controller's map.

    since

    2021.0

    Parameters

    • event: "Deactivated"
    • callback: (map: Map) => void
        • (map: Map): void
        • Parameters

          Returns void

    • Optional context: any

    Returns Handle

  • An event indicating that this Controller is invalidated. Invalidated means that the Controller requests for its onDraw to be called during the next rendering pass (because its appearance has changed). This event fires when invalidate is called.

    Parameters

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

    • Optional context: any

    Returns Handle

Accessors

Protected cursor

  • get cursor(): string | null
  • set cursor(cssCursor: string | null): void
  • The CSS cursor to use on the map, for this controller. If null, the map will fall back to the previous cursor that was set on the map.

    Note that changing this cursor will update the cursor on the map's DOM node. When using multiple controllers (e.g. in a CompositeController), the controller that updates the cursor last (to a non-null value), will override any other non-null cursors of active controllers on the map.

    see

    Map.cursorManager

    since

    2022.1

    Returns string | null

  • The CSS cursor to use on the map, for this controller. If null, the map will fall back to the previous cursor that was set on the map.

    Note that changing this cursor will update the cursor on the map's DOM node. When using multiple controllers (e.g. in a CompositeController), the controller that updates the cursor last (to a non-null value), will override any other non-null cursors of active controllers on the map.

    see

    Map.cursorManager

    since

    2022.1

    Parameters

    • cssCursor: string | null

    Returns any

map

  • get map(): Map | null
  • set map(_value: Map | null): void
  • The map on which this controller is currently active or null if this controller is not currently active. This property is read-only.

    Returns Map | null

  • The map on which this controller is currently active or null if this controller is not currently active. This property is read-only.

    Parameters

    • _value: Map | null

    Returns any

Methods

invalidate

  • (): void
  • Call this method to indicate that the controller's appearance has changed. Calling this method ensures the onDraw will be called during the next rendering pass.

    Returns void

isNoopGestureEvent

  • A hook to determine if a gesture event is a no-op. If true, the gesture event is handled by this controller. It does not propagate down the controller chain in a CompositeController and default map behavior is not triggered for this event. By default, this always returns true.

    Parameters

    • gestureEvent: GestureEvent

      The event that's considered as a no-op candidate

    Returns boolean

isNoopKeyEvent

  • A hook to determine if a key event is a no-op. If true, the key event is handled by this controller. It does not propagate down the controller chain in a CompositeController and default map behavior is not triggered for this event. By default, this always returns true.

    Parameters

    • keyEvent: KeyEvent

      The event that's considered as a no-op candidate

    Returns boolean

onActivate

  • (map: Map): void
  • Callback that is invoked when this controller is activated on a map. This method allows controller implementations to perform setup work.

    Parameters

    • map: Map

      the map on which the controller has been activated

    Returns void

onDeactivate

  • (map: Map): Promise<any> | any
  • Callback that is invoked when this controller is deactivated on a map. This method allows controller implementations to perform cleanup work. This method must return either any resolved value or a promise to indicate completion of deactivation. This allows controller implementation to perform asynchronous deactivation work. During the period between this method being called and the resolution of the deactivation promise, this controller will no longer receive input events, but will still get the opportunity to draw itself.

    Parameters

    • map: Map

      the map on which the controller has been deactivated

    Returns Promise<any> | any

    a concrete value to indicate immediate deactivation or a deactivation promise.

onDraw

  • Callback that allows controller implementations to perform custom drawing on the map. Controller shapes and icons are drawn on top of all other content in the map. Note that the map may perform caching which may cause this method to only be invoked once. When a controller implementation's appearance changes the implementation should call invalidate on itself.

    Parameters

    • geoCanvas: GeoCanvas

      the GeoCanvas on which the controller can draw shapes.

    Returns void

onDrawLabel

  • Callback that allows controller implementations to draw labels on the map. Note that the map may perform caching which may cause this method to only be invoked once. When a controller implementation's appearance changes the implementation should call invalidate on itself.

    Parameters

    • labelCanvas: LabelCanvas

      the LabelCanvas on which the controller can draw labels.

    Returns void

onGestureEvent

onKeyEvent

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