Skip to main content

LoadingWidget (Experimental)

from v9.2

This widget shows a spinning indicator while any deck.gl layers are loading data.

import {_LoadingWidget as LoadingWidget} from '@deck.gl/widgets';
import {Deck} from '@deck.gl/core';

const deck = new Deck({
widgets: [new LoadingWidget()]
});

Types

LoadingnWidgetProps

The LoadingnWidget accepts the generic WidgetProps:

  • id (default 'loading') - Unique id for this widget
  • placement (default 'top-left') - Widget position within the view relative to the map container
  • viewId (default null) - The viewId 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.

Props

id (string, optional)

Default: 'loading'

The id must be unique among all your widgets at a given time.

Note: It is necessary to set id explicitly if you have more than once instance of the same widget.

placement (string, optional)

Default: 'top-left'

Widget position within the view relative to the map container. Valid options are top-left, top-right, bottom-left, bottom-right, or fill.

label (string, optional)

Tooltip message displayed while hovering a mouse over the widget.

Default: 'Loading data'

Source

modules/widgets/src/loading-widget.tsx