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

[Bug] ArcGIS module broken in v9

Open felixpalmer opened this issue 1 year ago • 2 comments

Description

The ArcGIS integration is not working

Flavors

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

Expected Behavior

No response

Steps to Reproduce

Run /examples/get-started/pure-js/arcgis or /examples/get-started/react/arcgis

Environment

Logs

No response

felixpalmer avatar Jan 18 '24 09:01 felixpalmer

Taking a crack at this. The error, appears to be that the deckFbo isn't being created correctly, but initializeResources does seem to be called from deck-layer-view-2d.js. A console log of the context object shows an instance of WebGLRenderingContext and based of this PR it looks like it doesn't work with WebGl 1 and would be expecting WebGL2RenderingContext.

jaredscarr avatar Feb 20 '24 05:02 jaredscarr

@jaredscarr thanks :) yes it is the case that we need the context to be WebGL2

felixpalmer avatar Feb 20 '24 08:02 felixpalmer

It looks like with v9 the call to initialzeResources is expecting a Device, but is being passed a context . I have found the upgrade guide which shows how to create a Device. I attempted the directions to attach the context to a new Device, but get an error that Device.attach is not a function.

const gl = this.context;
const device = Device.attach(gl);

It seems like the issue is, we need to take the gl context that ArcGIS creates, and convert it/wrap it into a device. Is that correct? If so, are there any examples in the v9 codebase of how the gl context is created/how the device is created?

jaredscarr avatar Feb 22 '24 17:02 jaredscarr

Like this?

https://github.com/visgl/deck.gl/blob/2408740cb0af6790f55c6e69a7a3e53db1ae8ab1/modules/core/src/lib/deck.ts#L380

Pessimistress avatar Feb 23 '24 00:02 Pessimistress