visgl/deck.gl

[Bug] Widgets without `viewId` don't change the view their automatically added to.

Closed this issue · 0 comments

Description

When a user is using ZoomWidget without supplying the optional viewId prop and they provide their own View, such as views: new MapView({});, the widget does not change the viewState because it does not target the custom view. The same is true for the CompassWidget.

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

Widgets with undefined viewId should still effect the view's they're placed in automatically.

Steps to Reproduce

Add widgets to examples/website/data-filter/app.tsx:

import {CompassWidget, ZoomWidget, FullscreenWidget} from '@deck.gl/widgets';
import '@deck.gl/widgets/stylesheet.css';

<DeckGL
  ...
  widgets={[new ZoomWidget({}), new CompassWidget({}), new FullscreenWidget({})]}
>

Click on the + button and nothing happens.

Environment

  • Framework version: deck.gl@9
  • Browser: Chroms
  • OS: MacOS

Logs

No response