@deck.gl/arcgis 8.10.0-alpha.7 → 9.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/arcgis",
3
3
  "description": "Use deck.gl as a custom ArcGIS API for JavaScript layer",
4
4
  "license": "MIT",
5
- "version": "8.10.0-alpha.7",
5
+ "version": "9.0.0-alpha.3",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -32,11 +32,12 @@
32
32
  "peerDependencies": {
33
33
  "@arcgis/core": "^4.0.0",
34
34
  "@deck.gl/core": "^8.0.0",
35
- "@luma.gl/core": "^8.0.0"
35
+ "@luma.gl/core": "9.0.0-alpha.42",
36
+ "@luma.gl/engine": "9.0.0-alpha.42"
36
37
  },
37
38
  "dependencies": {
38
39
  "@babel/runtime": "^7.0.0",
39
40
  "esri-loader": "^3.3.0"
40
41
  },
41
- "gitHead": "1c62a9eec914019afd3969bc0c59f1488e491207"
42
+ "gitHead": "51dfb88f9168ccf478d01b28a2c5ada7bd8281c7"
42
43
  }
@@ -1,14 +1,17 @@
1
1
  /* eslint-disable no-invalid-this */
2
2
 
3
- import {Deck} from '@deck.gl/core';
4
- import {Model, Buffer, Framebuffer, instrumentGLContext, withParameters} from '@luma.gl/core';
3
+ import type {Device} from '@luma.gl/core';
4
+ import {Model} from '@luma.gl/engine';
5
+ import {GL} from '@luma.gl/constants';
6
+ import {withGLParameters} from '@luma.gl/webgl';
5
7
 
6
- export function initializeResources(gl) {
7
- instrumentGLContext(gl);
8
+ import {Deck} from '@deck.gl/core';
8
9
 
9
- this.buffer = new Buffer(gl, new Int8Array([-1, -1, 1, -1, -1, 1, 1, 1]));
10
+ export function initializeResources(device: Device) {
11
+ // What is `this` referring to this function???
12
+ this.buffer = device.createBuffer(new Int8Array([-1, -1, 1, -1, -1, 1, 1, 1]));
10
13
 
11
- this.model = new Model(gl, {
14
+ this.model = new Model(device, {
12
15
  vs: `
13
16
  attribute vec2 a_pos;
14
17
  varying vec2 v_texcoord;
@@ -28,13 +31,14 @@ export function initializeResources(gl) {
28
31
  }
29
32
  `,
30
33
  attributes: {
34
+ // eslint-disable-next-line camelcase
31
35
  a_pos: this.buffer
32
36
  },
33
37
  vertexCount: 4,
34
- drawMode: gl.TRIANGLE_STRIP
38
+ drawMode: GL.TRIANGLE_STRIP
35
39
  });
36
40
 
37
- this.deckFbo = new Framebuffer(gl, {width: 1, height: 1});
41
+ this.deckFbo = device.createFramebuffer({width: 1, height: 1});
38
42
 
39
43
  this.deckInstance = new Deck({
40
44
  // The view state will be set dynamically to track the MapView current extent.
@@ -44,7 +48,7 @@ export function initializeResources(gl) {
44
48
  controller: false,
45
49
 
46
50
  // We use the same WebGL context as the ArcGIS API for JavaScript.
47
- gl,
51
+ gl: device.gl,
48
52
 
49
53
  // We need depth testing in general; we don't know what layers might be added to the deck.
50
54
  parameters: {
@@ -83,7 +87,7 @@ export function render({gl, width, height, viewState}) {
83
87
  this.deckInstance.redraw('arcgis');
84
88
 
85
89
  // We overlay the texture on top of the map using the full-screen quad.
86
- withParameters(
90
+ withGLParameters(
87
91
  gl,
88
92
  {
89
93
  blend: true,
@@ -92,7 +96,8 @@ export function render({gl, width, height, viewState}) {
92
96
  viewport: [0, 0, width, height]
93
97
  },
94
98
  () => {
95
- this.model.setUniforms({u_texture: this.deckFbo}).draw();
99
+ // eslint-disable-next-line camelcase
100
+ this.model.setUniforms({u_texture: this.deckFbo}).draw(this.context.renderPass);
96
101
  }
97
102
  );
98
103
  }