new MapboxHoverInteraction(map, options)
Creates a new MapboxHoverInteraction instance.
| Name | Type | Description |
|---|---|---|
map |
The Mapbox map instance. |
|
options |
Configuration options for the hover interaction. |
Methods
-
clearHoveredFeatures()
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 225 -
Clears the list of hovered features.
-
disable()
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 64 -
Disables the hover interaction by removing event listeners and cleaning up.
-
enable()
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 56 -
Enables the hover interaction by attaching event listeners.
-
handleHover(e)
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 127 -
Handles mouse move events to detect and highlight features.
Name Type Description eThe map mouse event.
-
removeHighlightLayer()
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 250 -
Removes the temporary highlight layer and source.
-
selectPriorityFeatures(features)
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 92 -
Selects the highest priority feature from a collection based on geometry type. Priority order: Point > Line > Polygon. Returns only the first feature from the highest priority group.
Name Type Description featuresArray of features to filter.
Returns:
Array containing at most one feature with the highest priority geometry type. -
setOptions(options)
MapboxViewer/infrastructure/adapters/interactions/MapboxHoverInteraction.ts, line 76 -
Updates the interaction options.
Name Type Description optionsNew options to apply.
