LuciadRIA (2026.0.05)
    Preparing search index...

    A controller that allows the user to hover objects on the map.

    Note that FeatureLayer.hoverable needs to be enabled as well, for hovering to work.

    This controller only handles mouse events.

    Note that this controller consumes GestureEventType.MOVE events. Controllers down the chain (see CompositeController), might also consume MOVE events, for example to update an icon under mouse. Because of this, it's recommended to put this controller after other controllers.

    For a list of events handled by this controller, see isPickEvent.

    const defaultController = new CompositeController();
    defaultController.appendController(new SelectController());
    defaultController.appendController(new ContextMenuController());
    defaultController.appendController(new PanController());
    defaultController.appendController(new RotateController());
    defaultController.appendController(new ZoomController());
    defaultController.appendController(new HoverController());

    You can customize this controller's behavior by overriding its hooks:

    class CustomHoverController extends HoverController {

    getPaintRepresentations(event: GestureEvent): PaintRepresentation[] {
    return [PaintRepresentation.BODY]; // disallow hovering over label. Consider keeping this consistent with a custom SelectController as well.
    }

    getSensitivity(event: GestureEvent): number {
    return 30; // use a bigger sensitivity (interaction radius)
    }

    }

    map.defaultController = new DefaultController({
    hoverController: new CustomHoverController()
    });

    When customizing a HoverController, consider doing the same customizations to SelectController. This ensures that hovering and selection are consistent. Objects that are hovered, are also selection candidates.

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

    2022.1

    Hierarchy (View Summary)

    Constructors

    Accessors

    • get async(): boolean

      Whether picking should be performed asynchronously.

      When set to true, picking will be performed asynchronously, using getCandidatesAsync. When set to false, picking will be performed synchronously, using getCandidates.

      Asynchronous picking is the default and recommended way of picking on TileSet3DLayer. If you do want to force synchronous picking on 3D layers, you can set TileSet3DLayerConstructorOptions.synchronousPicking to true., For FeatureLayer, synchronous picking is usually fast enough, so asynchronous picking is not required.

      Note that when async is enabled, onGestureEvent will always return HandleEventResult.EVENT_IGNORED, regardless of handleCandidates's return value.

      By default, this is set to false.

      Returns boolean

      2026.0

    • set async(value: boolean): void

      Parameters

      • value: boolean

      Returns void

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

      Returns string | null

      2022.1

    • set cursor(cssCursor: string | null): void

      Parameters

      • cssCursor: string | null

      Returns void

    • get map(): RIAMap | null

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

      Returns RIAMap | null

    • set map(_value: RIAMap | null): void

      Parameters

      Returns void

    Methods

    • 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

    • Indicates whether getCandidates should consider multiple candidates.

      When this returns false, getCandidates stops when it has found the first (closest) feature. Picking the closest feature is faster than considering multiple candidates.

      By default, this returns false.

      Parameters

      Returns boolean

      2024.0

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

      Parameters

      • map: RIAMap

        the map on which the controller has been activated

      Returns void

    • 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: RIAMap

        the map on which the controller has been deactivated

      Returns void | Promise<void>

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

    • 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

    • 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

    • Called when a key event has been received. This method must return a HandleEventResult value to indicate if the event was handled or not, If this method returns EVENT_IGNORED, the map will be given the opportunity to perform default key event behaviour. If default event handling is not desired, this method should return EVENT_HANDLED. (See the Controller class description for the default behavior.)

      Parameters

      • keyEvent: KeyEvent

        The key event to be handled. Note that this is a KeyEvent and not a DOMEvent. You can access the corresponding DOMEvent through KeyEvent.domEvent.

      Returns HandleEventResult

      The key event handling result.

    Events