> For the complete documentation index, see [llms.txt](https://docs.weatherlayers.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.weatherlayers.com/weatherlayers-gl/controls/tooltip-control.md).

# Tooltip Control

Tooltip control shows the value (and the direction for vector datasets) at current mouse position on hovering the raster layer

### Example

![Tooltip Control](/files/TNaXGQKpleuFKOPvGR1N)

```javascript
import * as WeatherLayers from 'weatherlayers-gl';

const tooltipControl = new WeatherLayers.TooltipControl({
  unitFormat: {
    unit: 'm/s',
  },
  directionFormat: WeatherLayers.DirectionFormat.CARDINAL3,
  followCursor: true,
});
tooltipControl.addTo(deckgl.getCanvas().parentElement);
deckgl.setProps({ onHover: event => tooltipControl.updatePickingInfo(event) });
```

### Constructor

#### `TooltipControl(config: TooltipConfig = {})`

### Config Properties

#### `unitFormat`

Type: [`UnitFormat`](/weatherlayers-gl/types.md#unitformat), required

Unit definition to be used for formatting.

#### `directionType`

Type: [`DirectionType`](/weatherlayers-gl/types.md#directiontype), optional

Default value: `INWARD`

Direction type to be used for formatting.

#### `directionFormat`

Type: [`DirectionFormat`](/weatherlayers-gl/types.md#directionformat), optional

Default value: `VALUE`

Direction format to be used for formatting.

#### `followCursor`

Type: boolean, optional

Default value: false

Follow the mouse cursor position.

#### `followCursorOffset`

Type: number, optional

Default value: `16`

Offset from the mouse cursor position.

#### `followCursorPlacement`

Type: [`Placement`](/weatherlayers-gl/types.md#placement), optional

Default value: `BOTTOM`

Placement from the mouse cursor position.

### Methods

See [Control](/weatherlayers-gl/controls/control.md) for common Control methods.

#### `update(rasterPointProperties:` [`RasterPointProperties`](/weatherlayers-gl/types.md#rasterpointproperties) `| undefined): void`

Updates the tooltip displayed with the given `rasterPointProperties` or hides the tooltip.

#### `updatePickingInfo(pickingInfo: PickingInfo & { raster?:` [`RasterPointProperties`](/weatherlayers-gl/types.md#rasterpointproperties) `}): void`

Updates the tooltip displayed with the given `pickingInfo` or hides the tooltip.
