Class: MapboxTooltipInteraction

MapboxTooltipInteraction

Class to handle tooltip interactions on a Mapbox map. Displays a popup with feature information when clicking on the map.

new MapboxTooltipInteraction(map, options)

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 6

Creates a new MapboxTooltipInteraction instance.

Name Type Description
map

The Mapbox map instance.

options

Configuration options for the tooltip interaction.

Methods

disable()

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 53

Disables the tooltip interaction.

enable()

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 43

Enables the tooltip interaction.

formatLabel(key)

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 196

Formats a property key into a human-readable label.

Name Type Description
key

Property key.

Returns:
Formatted label.

formatTooltipContent(properties, propKeys)

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 177

Formats tooltip content with structured HTML.

Name Type Description
properties

Feature properties to display.

propKeys

Property keys to include.

Returns:
Formatted HTML string.

formatValue(value)

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 205

Formats a property value for display.

Name Type Description
value

Property value.

Returns:
Formatted string representation.

handleClick(e)

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 78

Handles click events to display tooltip with feature information.

Name Type Description
e

The map click event.

hidePopup()

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 165

Hides the popup.

setOptions(options)

MapboxViewer/infrastructure/adapters/interactions/MapboxTooltipInteraction.ts, line 67

Updates the interaction options.

Name Type Description
options

New options to apply.