CompassWidget
This widget visualizes bearing and pitch. Click it once to reset bearing to 0, click it a second time to reset pitch to 0. Supports Map and Globe view.
Usage
import {Deck} from '@deck.gl/core';
import {CompassWidget} from '@deck.gl/widgets';
new Deck({
widgets: [new CompassWidget()]
});
Types
CompassWidgetProps
The CompassWidget accepts the generic WidgetProps and:
label (string, optional)
- Default:
'Compass'
Tooltip message displayed while hovering a mouse over the widget.
transitionDuration (number, optional)
- Default:
200
Bearing and pitch reset transition duration in milliseconds.
Styles
Learn more about how to replace icons in the styling guide.
| Name | Type | Default |
|---|---|---|
--icon-compass | SVG Data Url | Custom Icon |
--icon-compass-north-color | Color | rgb(240, 92, 68) |
--icon-compass-south-color | Color | rgb(204, 204, 204) |