deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

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

Open chrisgervang opened this issue 1 year ago • 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
  • [x] 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

chrisgervang avatar May 19 '24 00:05 chrisgervang