import {WidgetPreview} from '@site/src/doc-demos/widgets'; import {_LoadingWidget} from '@deck.gl/widgets';
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()]
});The LoadingnWidget accepts the generic WidgetProps:
id(default'loading') - Unique id for this widgetplacement(default'top-left') - Widget position within the view relative to the map containerviewId(defaultnull) - TheviewIdprop 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.
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.
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.
Tooltip message displayed while hovering a mouse over the widget.
Default: 'Loading data'