Skip to main content

LoadingWidget

from v9.2

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

import {Deck} from '@deck.gl/core';
import {LoadingWidget} from '@deck.gl/widgets';
import '@deck.gl/widgets/stylesheet.css';

new Deck({
widgets: [
new LoadingWidget({placement: 'top-left'})
]
});

Constructor

import {LoadingWidget, type LoadingWidgetProps} from '@deck.gl/widgets';
new LoadingWidget({} satisfies LoadingWidgetProps);

Types

LoadingWidgetProps

The InfoWidget accepts the generic WidgetProps and:

label (string, optional)

  • Default: 'Loading data'

Text used as the button's aria-label and displayed as a styled tooltip on hover/focus.

tooltip (string | HTMLElement | false, optional)

  • Default: value of label

Custom tooltip content. Overrides the default label text in the tooltip. Pass false to disable.

onLoadingChange (Function, optional)

(loading: boolean) => void
  • Default: () => {}

Callback when the loading state changes. Called when layers transition between loading and loaded states.

Source

modules/widgets/src/loading-widget.tsx