@deck.gl/carto 9.0.18 → 9.0.20

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
@@ -3,7 +3,7 @@
3
3
  "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.0.18",
6
+ "version": "9.0.20",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -47,7 +47,6 @@
47
47
  "@loaders.gl/mvt": "^4.2.0",
48
48
  "@loaders.gl/schema": "^4.2.0",
49
49
  "@loaders.gl/tiles": "^4.2.0",
50
- "@luma.gl/constants": "^9.0.14",
51
50
  "@luma.gl/core": "^9.0.14",
52
51
  "@luma.gl/shadertools": "^9.0.14",
53
52
  "@math.gl/web-mercator": "^4.0.0",
@@ -73,5 +72,5 @@
73
72
  "@deck.gl/layers": "^9.0.0",
74
73
  "@loaders.gl/core": "^4.2.0"
75
74
  },
76
- "gitHead": "32f7e51eb96319739a18a3ca22092e60948fcbdb"
75
+ "gitHead": "f3c26e0ba9236ae9a12fc2656ac7c4931d21b138"
77
76
  }
@@ -1,4 +1,4 @@
1
- import {GL} from '@luma.gl/constants';
1
+ import {ColorParameters} from '@luma.gl/core';
2
2
  import {Layer, log} from '@deck.gl/core';
3
3
  import {
4
4
  AGGREGATION,
@@ -83,13 +83,18 @@ export function parseMap(json) {
83
83
  };
84
84
  }
85
85
 
86
- function createParametersProp(layerBlending, parameters: Record<string, any>) {
86
+ function createParametersProp(layerBlending: string, parameters: ColorParameters) {
87
87
  if (layerBlending === 'additive') {
88
- parameters.blendFunc = [GL.SRC_ALPHA, GL.DST_ALPHA];
89
- parameters.blendEquation = GL.FUNC_ADD;
88
+ parameters.blendColorSrcFactor = parameters.blendAlphaSrcFactor = 'src-alpha';
89
+ parameters.blendColorDstFactor = parameters.blendAlphaDstFactor = 'dst-alpha';
90
+ parameters.blendColorOperation = parameters.blendAlphaOperation = 'add';
90
91
  } else if (layerBlending === 'subtractive') {
91
- parameters.blendFunc = [GL.ONE, GL.ONE_MINUS_DST_COLOR, GL.SRC_ALPHA, GL.DST_ALPHA];
92
- parameters.blendEquation = [GL.FUNC_SUBTRACT, GL.FUNC_ADD];
92
+ parameters.blendColorSrcFactor = 'one';
93
+ parameters.blendColorDstFactor = 'one-minus-dst-color';
94
+ parameters.blendAlphaSrcFactor = 'src-alpha';
95
+ parameters.blendAlphaDstFactor = 'dst-alpha';
96
+ parameters.blendColorOperation = 'subtract';
97
+ parameters.blendAlphaOperation = 'add';
93
98
  }
94
99
 
95
100
  return Object.keys(parameters).length ? {parameters} : {};
@@ -153,9 +153,9 @@ class HeatmapTileLayer<DataT = any, ExtraProps extends {} = {}> extends Composit
153
153
 
154
154
  let tileZ = 0;
155
155
  let maxDensity = 0;
156
- const tiles = [...this.state.tiles].filter(t => t.isVisible && t.data);
156
+ const tiles = [...this.state.tiles].filter(t => t.isVisible && t.content);
157
157
  for (const tile of tiles) {
158
- const cell = tile.data[0];
158
+ const cell = tile.content[0];
159
159
  const unitDensity = unitDensityForCell(cell.id);
160
160
  maxDensity = Math.max(tile.userData!.maxWeight * unitDensity, maxDensity);
161
161
  tileZ = Math.max(tile.zoom, tileZ);