Tooltip Control
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 = {})
TooltipControl(config: TooltipConfig = {})Config Properties
unitFormat
unitFormatType: UnitFormat, required
Unit definition to be used for formatting.
directionType
directionTypeType: DirectionType, optional
Default value: INWARD
Direction type to be used for formatting.
directionFormat
directionFormatType: DirectionFormat, optional
Default value: VALUE
Direction format to be used for formatting.
followCursor
followCursorType: boolean, optional
Default value: false
Follow the mouse cursor position.
followCursorOffset
followCursorOffsetType: number, optional
Default value: 16
Offset from the mouse cursor position.
followCursorPlacement
followCursorPlacementType: Placement, optional
Default value: BOTTOM
Placement from the mouse cursor position.
Methods
See Control for common Control 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.
Last updated