WeatherLayers
DemoIntegrationsDocsStatus
  • Overview
  • WeatherLayers GL
    • Quick Start
    • Layers
      • Particle Layer
      • Raster Layer
      • Contour Layer
      • HighLow Layer
      • Front Layer
      • Grid Layer
      • Data Loading
      • Data Properties
      • Style Properties
    • Controls
      • Legend Control
      • Timeline Control
      • Tooltip Control
      • Attribution Control
      • Logo Control
      • Control
    • Types
    • Functions
    • Data Sources
    • Security
    • Troubleshooting
    • Pricing
    • Changelog
    • Roadmap
  • WeatherLayers Cloud
    • Quick Start
    • Client
    • Types
    • Security
    • Troubleshooting
    • Datasets
    • Pricing
    • Changelog
    • Roadmap
  • Contact
Powered by GitBook
On this page
  • Example
  • Constructor
  • Config Properties
  • Methods
  1. WeatherLayers GL
  2. Controls

Tooltip Control

Last updated 1 year ago

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

Example

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

Unit definition to be used for formatting.

directionType

Default value: INWARD

Direction type to be used for formatting.

directionFormat

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

Default value: BOTTOM

Placement from the mouse cursor position.

Methods

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

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

Type: , required

Type: , optional

Type: , optional

Type: , optional

See for common Control methods.

update(rasterPointProperties: | undefined): void

updatePickingInfo(pickingInfo: PickingInfo & { raster?: }): void

Control
Tooltip Control
UnitFormat
DirectionType
DirectionFormat
Placement
RasterPointProperties
RasterPointProperties