Skip to main content

ResetViewWidget

from v9.2

This widget resets the view state of a deck.gl viewport to its initial state. The user clicks the widget to return to the initial view.

import {ResetViewWidget} from '@deck.gl/widgets';
import {Deck} from '@deck.gl/core';

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

Types

ResetViewWidgetProps

The ResetViewWidget accepts the generic WidgetProps:

  • id (default 'reset-view') - 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.

label (string, optional)

Tooltip message displayed while hovering a mouse over the widget.

Default: 'Reset View'

Styles

Learn more about how to replace icons in the styling guide.

NameTypeDefault
--icon-reset-viewSVG Data Url[Material Symbol Reset Focus][icon_reset_view]

Source

modules/widgets/src/reset-view-widget.tsx