@deck.gl/carto 8.7.0-beta.2 → 8.7.0-beta.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/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.2",
5
+ "version": "8.7.0-beta.3",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -49,5 +49,5 @@
49
49
  "@deck.gl/layers": "^8.0.0",
50
50
  "@loaders.gl/core": "^3.1.5"
51
51
  },
52
- "gitHead": "a507df6d9a5d9d9bba3a97ac93246b6ed0e5dd43"
52
+ "gitHead": "32879c662f37d4c912cf702c220a75d6cd0a67bc"
53
53
  }
@@ -26,6 +26,12 @@ export const FORMATS = {
26
26
  JSON: 'json'
27
27
  };
28
28
 
29
+ export const TILE_FORMATS = {
30
+ MVT: 'mvt',
31
+ GEOJSON: 'geojson',
32
+ BINARY: 'binary'
33
+ };
34
+
29
35
  /**
30
36
  * Simple encode parameter
31
37
  */
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export {getDefaultCredentials, setDefaultCredentials} from './config.js';
2
2
  export {default as CartoLayer} from './layers/carto-layer';
3
+ export {default as _CartoDynamicTileLayer} from './layers/carto-dynamic-tile-layer';
3
4
  export {default as BASEMAP} from './basemap';
4
5
  export {default as colorBins} from './style/color-bins-style';
5
6
  export {default as colorCategories} from './style/color-categories-style';
@@ -3,7 +3,7 @@ import CartoDynamicTileLayer from './carto-dynamic-tile-layer';
3
3
  import {MVTLayer} from '@deck.gl/geo-layers';
4
4
  import {GeoJsonLayer} from '@deck.gl/layers';
5
5
  import {fetchLayerData, getDataV2, API_VERSIONS} from '../api';
6
- import {FORMATS, MAP_TYPES} from '../api/maps-api-common';
6
+ import {FORMATS, MAP_TYPES, TILE_FORMATS} from '../api/maps-api-common';
7
7
  import {getDefaultCredentials} from '../config';
8
8
 
9
9
  const defaultProps = {
@@ -128,11 +128,17 @@ export default class CartoLayer extends CompositeLayer {
128
128
 
129
129
  if (!data) return null;
130
130
 
131
- const {type, updateTriggers} = this.props;
131
+ const {updateTriggers} = this.props;
132
132
 
133
133
  let layer;
134
134
 
135
- if (apiVersion === API_VERSIONS.V3 && type === MAP_TYPES.TABLE && format === FORMATS.TILEJSON) {
135
+ /* global URLSearchParams */
136
+ const tilesFormat =
137
+ apiVersion === API_VERSIONS.V3 &&
138
+ format === FORMATS.TILEJSON &&
139
+ new URLSearchParams(data.tiles[0]).get('format');
140
+
141
+ if (tilesFormat && tilesFormat !== TILE_FORMATS.MVT) {
136
142
  layer = CartoDynamicTileLayer;
137
143
  } else if (
138
144
  apiVersion === API_VERSIONS.V1 ||