A controller that implements the default map behavior.

See the Managing user input with LuciadRIA controllers dev article for a description of the default map behavior.

You can override parts of the default behavior by specifying a custom controller as a constructor option. For example, to customize selection:

class CustomSelectController extends SelectController {

getPaintRepresentations(event: GestureEvent): PaintRepresentation[] {
return [PaintRepresentation.BODY]; // disallow selection by label
}

isShowBalloon(gestureEvent: GestureEvent, selectionCandidate: PickInfo): boolean {
return false; // don't show balloons, ever
}

}

map.defaultController = new DefaultController({
selectController: new CustomSelectController()
});

Hierarchy (view full)

Constructors

Accessors

  • get cursor(): null | string
  • 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.

    Returns null | string

    See

    Map.cursorManager

    Since

    2022.1

  • set cursor(cssCursor): void
  • Parameters

    • cssCursor: null | string

    Returns void

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

    Returns null | Map

  • set map(_value): void
  • Parameters

    • _value: null | Map

    Returns void

Methods

  • Chains a new controller at the end of this CompositeController's delegates. Note that you cannot append controllers while the CompositeController is active on the map.

    Parameters

    • controller: Controller

      The new controller to append to the chain of controllers

    Returns void

  • Called when the controller becomes active on the map. Controller.onActivate is called for every controller in the chain.

    Parameters

    • map: Map

      the map on which the controller has been activated

    Returns void

  • Chains a new controller to the start of this CompositeController's delegates. Note that you cannot prepend controllers while the CompositeController is active on the map.

    Parameters

    • controller: Controller

      The new controller to prepend to the chain of controllers

    Returns void

    Since

    2024.0

Events

"Activated" event

  • on("Activated", callback: ((map) => 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.

    Parameters

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

          Returns void

    • Optional context: any

    Returns Handle

    Since

    2021.0

"Deactivated" event

  • on("Deactivated", callback: ((map) => void), context?: any) : 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.

    Parameters

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

          Returns void

    • Optional context: any

    Returns Handle

    Since

    2021.0

"Invalidated" event

  • on("Invalidated", callback: (() => void), context?: any) : 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