A controller that implements the default map navigation.

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 navigation by specifying a custom controller as a constructor option. For example, to customize panning:

  class CustomPanController extends PanController {

isInertia(gestureEvent: GestureEvent): boolean {
return gestureEvent.inputType === "touch"; // only enable inertia for touch
}

}

const navigateController = new NavigateController({
panController: new CustomPanController()
});
map.defaultController = new DefaultController({
navigateController
});

2024.0

Hierarchy (View Summary)

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

    2022.1

  • set cursor(cssCursor: null | string): 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: null | Map): void

    Parameters

    • _value: null | Map

    Returns void

  • get panController(): null | Controller

    The pan controller used by this NavigateController. Defaults to a PanController. If null, panning is disabled.

    Returns null | Controller

  • get rotateController(): null | Controller

    The rotate controller used by this NavigateController. Defaults to a RotateController. If null, rotation is disabled.

    Returns null | Controller

  • get zoomController(): null | Controller

    The zoom controller used by this NavigateController. Defaults to a ZoomController. If null, zooming is disabled.

    Returns null | Controller

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

  • 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

    2024.0

Events

  • 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: Map) => void
    • Optionalcontext: any

    Returns Handle

    2021.0

  • 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: Map) => void
    • Optionalcontext: any

    Returns Handle

    2021.0

  • 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
    • Optionalcontext: any

    Returns Handle