visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.25k stars 2.08k forks source link

[Bug] ArcGIS module broken in v9 #8428

Closed felixpalmer closed 8 months ago

felixpalmer commented 10 months ago

Description

The ArcGIS integration is not working

Flavors

Expected Behavior

No response

Steps to Reproduce

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

Environment

Logs

No response

jaredscarr commented 8 months ago

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.

felixpalmer commented 8 months ago

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

jaredscarr commented 8 months ago

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?

Pessimistress commented 8 months ago

Like this?

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