Skip to main content

ResetViewWidget

from v9.3

ResetViewWidget is a small icon button widget that invokes a caller-provided “fit/reset view” callback.

Import

import {ResetViewWidget} from '@deck.gl-community/widgets';

Props

type ResetViewWidgetProps = WidgetProps & {
placement?: WidgetPlacement;
label?: string;
onResetView?: () => void;
};

Default props:

  • id: 'reset-view'
  • placement: 'top-left'
  • label: 'Resize to fit'

Usage

Within this repo it is typically wired to a DeckTraceGraph or controller callback that recomputes visible bounds and resets the camera.

Remarks

  • Renders a single icon button.
  • Uses label for tooltip and aria label.
  • Calls onResetView when clicked.