Skip to main content

ScaleWidget (Experimental)

from v9.2

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.

Usage

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 and:

label (string, optional)

  • Default: 'Scale'

Tooltip label for the widget.

Source

modules/widgets/src/scale-widget.tsx