ScaleWidget (Experimental)
This widget displays a dynamic cartographic scale bar that updates as the map view changes. It shows a horizontal line with end tick marks and a distance label, reflecting the current map scale based on zoom level and latitude.
import {_ScaleWidget as ScaleWidget} from '@deck.gl/widgets';
import {Deck} from '@deck.gl/core';
const deck = new Deck({
widgets: [new ScaleWidget({placement: 'bottom-left', label: 'Scale'})]
});
Types
ResetViewWidgetProps
The ResetViewWidget
accepts the generic WidgetProps
:
id
(default'scale'
) - Unique id for this widgetplacement
(default'top-left'
) - Widget position within the view relative to the map containerviewId
(defaultnull
) - TheviewId
prop controls how a widget interacts with views.style
(default{}
) - Additional inline styles on the top HTML element.className
(default''
) - Additional classnames on the top HTML element.
label
(string, optional)
Default: 'Scale'
Tooltip label for the widget.