@deck.gl/carto 8.7.0-beta.6 → 8.7.0-beta.7

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/carto",
3
3
  "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
4
4
  "license": "MIT",
5
- "version": "8.7.0-beta.6",
5
+ "version": "8.7.0-beta.7",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -56,5 +56,5 @@
56
56
  "@deck.gl/layers": "^8.0.0",
57
57
  "@loaders.gl/core": "^3.1.5"
58
58
  },
59
- "gitHead": "d6eefe2e0992999416b2362340f86402b1f25b33"
59
+ "gitHead": "32b25b0d1c4d2985b021eb15f2b2245d81b574bd"
60
60
  }
@@ -126,24 +126,29 @@ export default class CartoLayer extends CompositeLayer {
126
126
  }
127
127
  }
128
128
 
129
- _getRenderLayer() {
129
+ _getSubLayerAndProps() {
130
130
  const {data, format, apiVersion} = this.state;
131
131
 
132
+ const {uniqueIdProperty} = defaultProps;
133
+ const props = {uniqueIdProperty, ...this.props};
134
+ delete props.data;
135
+
132
136
  if (apiVersion === API_VERSIONS.V1 || apiVersion === API_VERSIONS.V2) {
133
- return MVTLayer;
137
+ return [MVTLayer, props];
134
138
  }
135
139
 
136
140
  if (format === FORMATS.TILEJSON) {
137
141
  /* global URL */
138
- const formatTiles =
139
- this.props.formatTiles ||
142
+ props.formatTiles =
143
+ props.formatTiles ||
140
144
  new URL(data.tiles[0]).searchParams.get('formatTiles') ||
141
145
  TILE_FORMATS.MVT;
142
- return formatTiles === TILE_FORMATS.MVT ? MVTLayer : CartoTileLayer;
146
+
147
+ return props.formatTiles === TILE_FORMATS.MVT ? [MVTLayer, props] : [CartoTileLayer, props];
143
148
  }
144
149
 
145
150
  // It's a geojson layer
146
- return GeoJsonLayer;
151
+ return [GeoJsonLayer, props];
147
152
  }
148
153
 
149
154
  renderLayers() {
@@ -153,11 +158,7 @@ export default class CartoLayer extends CompositeLayer {
153
158
 
154
159
  const {updateTriggers} = this.props;
155
160
 
156
- const layer = this._getRenderLayer();
157
-
158
- const {formatTiles, uniqueIdProperty} = defaultProps;
159
- const props = {formatTiles, uniqueIdProperty, ...this.props};
160
- delete props.data;
161
+ const [layer, props] = this._getSubLayerAndProps();
161
162
 
162
163
  // eslint-disable-next-line new-cap
163
164
  return new layer(
@@ -61,7 +61,7 @@ const CartoTileLoader = {
61
61
  options: {
62
62
  cartoTile: {
63
63
  // TODO change to BINARY for 8.7 prod release
64
- formatTiles: TILE_FORMATS.GEOJSON
64
+ formatTiles: TILE_FORMATS.BINARY
65
65
  }
66
66
  }
67
67
  };