@deck.gl/carto 8.7.0-alpha.1 → 8.7.0-alpha.8

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.
Files changed (62) hide show
  1. package/dist/dist.dev.js +1521 -1700
  2. package/dist/es5/api/layer-map.js +4 -3
  3. package/dist/es5/api/layer-map.js.map +1 -1
  4. package/dist/es5/api/maps-client.js +2 -2
  5. package/dist/es5/api/maps-client.js.map +1 -1
  6. package/dist/es5/api/maps-v3-client.js +34 -27
  7. package/dist/es5/api/maps-v3-client.js.map +1 -1
  8. package/dist/es5/api/parseMap.js +9 -13
  9. package/dist/es5/api/parseMap.js.map +1 -1
  10. package/dist/es5/config.js +15 -24
  11. package/dist/es5/config.js.map +1 -1
  12. package/dist/es5/index.js +0 -16
  13. package/dist/es5/index.js.map +1 -1
  14. package/dist/es5/layers/carto-layer.js +50 -51
  15. package/dist/es5/layers/carto-layer.js.map +1 -1
  16. package/dist/es5/style/color-bins-style.js +6 -2
  17. package/dist/es5/style/color-bins-style.js.map +1 -1
  18. package/dist/es5/style/color-categories-style.js +7 -3
  19. package/dist/es5/style/color-categories-style.js.map +1 -1
  20. package/dist/es5/style/color-continuous-style.js +6 -2
  21. package/dist/es5/style/color-continuous-style.js.map +1 -1
  22. package/dist/es5/style/palette.js +6 -2
  23. package/dist/es5/style/palette.js.map +1 -1
  24. package/dist/esm/api/layer-map.js +3 -2
  25. package/dist/esm/api/layer-map.js.map +1 -1
  26. package/dist/esm/api/maps-client.js +1 -1
  27. package/dist/esm/api/maps-client.js.map +1 -1
  28. package/dist/esm/api/maps-v3-client.js +23 -13
  29. package/dist/esm/api/maps-v3-client.js.map +1 -1
  30. package/dist/esm/api/parseMap.js +3 -10
  31. package/dist/esm/api/parseMap.js.map +1 -1
  32. package/dist/esm/config.js +11 -26
  33. package/dist/esm/config.js.map +1 -1
  34. package/dist/esm/index.js +0 -2
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/layers/carto-layer.js +28 -28
  37. package/dist/esm/layers/carto-layer.js.map +1 -1
  38. package/dist/esm/style/color-bins-style.js +1 -1
  39. package/dist/esm/style/color-bins-style.js.map +1 -1
  40. package/dist/esm/style/color-continuous-style.js +1 -1
  41. package/dist/esm/style/color-continuous-style.js.map +1 -1
  42. package/dist.min.js +4 -4
  43. package/package.json +7 -7
  44. package/src/api/layer-map.js +3 -2
  45. package/src/api/maps-client.js +3 -7
  46. package/src/api/maps-v3-client.js +24 -13
  47. package/src/api/parseMap.js +17 -26
  48. package/src/config.js +8 -39
  49. package/src/index.js +0 -2
  50. package/src/layers/carto-layer.js +17 -23
  51. package/src/style/color-bins-style.js +2 -4
  52. package/src/style/color-continuous-style.js +2 -4
  53. package/dist/es5/layers/carto-bqtiler-layer.js +0 -65
  54. package/dist/es5/layers/carto-bqtiler-layer.js.map +0 -1
  55. package/dist/es5/layers/carto-sql-layer.js +0 -66
  56. package/dist/es5/layers/carto-sql-layer.js.map +0 -1
  57. package/dist/esm/layers/carto-bqtiler-layer.js +0 -16
  58. package/dist/esm/layers/carto-bqtiler-layer.js.map +0 -1
  59. package/dist/esm/layers/carto-sql-layer.js +0 -17
  60. package/dist/esm/layers/carto-sql-layer.js.map +0 -1
  61. package/src/layers/carto-bqtiler-layer.js +0 -21
  62. package/src/layers/carto-sql-layer.js +0 -22
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-alpha.1",
5
+ "version": "8.7.0-alpha.8",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -31,10 +31,10 @@
31
31
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env.dev"
32
32
  },
33
33
  "dependencies": {
34
- "@loaders.gl/loader-utils": "^3.0.8",
35
- "@loaders.gl/mvt": "^3.0.8",
36
- "@loaders.gl/tiles": "^3.0.8",
37
- "@math.gl/web-mercator": "^3.5.4",
34
+ "@loaders.gl/loader-utils": "^3.1.0",
35
+ "@loaders.gl/mvt": "^3.1.0",
36
+ "@loaders.gl/tiles": "^3.1.0",
37
+ "@math.gl/web-mercator": "^3.5.6",
38
38
  "cartocolor": "^4.0.2",
39
39
  "d3-array": "^2.8.0",
40
40
  "d3-color": "^2.0.0",
@@ -46,7 +46,7 @@
46
46
  "@deck.gl/core": "^8.0.0",
47
47
  "@deck.gl/geo-layers": "^8.0.0",
48
48
  "@deck.gl/layers": "^8.0.0",
49
- "@loaders.gl/core": "^3.0.0"
49
+ "@loaders.gl/core": "^3.1.0"
50
50
  },
51
- "gitHead": "dbaa3941a41f3ddceecad4d2d2879515d97d2510"
51
+ "gitHead": "c16c8941fe5f2e823bd15a4b9ca4be12d589b0b2"
52
52
  }
@@ -28,6 +28,7 @@ const SCALE_FUNCS = {
28
28
  const sharedPropMap = {
29
29
  color: 'getFillColor',
30
30
  isVisible: 'visible',
31
+ label: 'cartoLabel',
31
32
  textLabel: {
32
33
  alignment: 'getTextAlignmentBaseline',
33
34
  anchor: 'getTextAnchor',
@@ -117,7 +118,7 @@ function calculateDomain(data, name, scaleType) {
117
118
  // GeoJSON data type
118
119
  const values = data.features.map(({properties}) => properties[name]);
119
120
  return domainFromValues(values, scaleType);
120
- } else if (Array.isArray(data) && data[0][name]) {
121
+ } else if (Array.isArray(data) && data[0][name] !== undefined) {
121
122
  // JSON data type
122
123
  const values = data.map(properties => properties[name]);
123
124
  return domainFromValues(values, scaleType);
@@ -139,7 +140,7 @@ export function getColorAccessor({name}, scaleType, {colors}, opacity, data) {
139
140
  const scale = SCALE_FUNCS[scaleType]();
140
141
  scale.domain(calculateDomain(data, name, scaleType));
141
142
  scale.range(colors);
142
- const alpha = opacity !== undefined ? 255 * Math.pow(opacity, 1 / 2.2) : 255;
143
+ const alpha = opacity !== undefined ? Math.round(255 * Math.pow(opacity, 1 / 2.2)) : 255;
143
144
 
144
145
  const accessor = properties => {
145
146
  const rgba = rgb(scale(properties[name]));
@@ -56,7 +56,7 @@ export async function getDataV2({type, source, credentials}) {
56
56
 
57
57
  default:
58
58
  throw new Error(
59
- `Invalid maps API version. It shoud be ${API_VERSIONS.V1} or ${API_VERSIONS.V2}`
59
+ `Invalid maps API version. It should be ${API_VERSIONS.V1} or ${API_VERSIONS.V2}`
60
60
  );
61
61
  }
62
62
  }
@@ -95,15 +95,11 @@ function dealWithError({response, json, credentials}) {
95
95
  switch (response.status) {
96
96
  case 401:
97
97
  throw new Error(
98
- `Unauthorized access to Maps API: invalid combination of user ('${
99
- credentials.username
100
- }') and apiKey ('${credentials.apiKey}')`
98
+ `Unauthorized access to Maps API: invalid combination of user ('${credentials.username}') and apiKey ('${credentials.apiKey}')`
101
99
  );
102
100
  case 403:
103
101
  throw new Error(
104
- `Unauthorized access to dataset: the provided apiKey('${
105
- credentials.apiKey
106
- }') doesn't provide access to the requested data`
102
+ `Unauthorized access to dataset: the provided apiKey('${credentials.apiKey}') doesn't provide access to the requested data`
107
103
  );
108
104
 
109
105
  default:
@@ -239,12 +239,12 @@ export async function getData({type, source, connection, credentials, geoColumn,
239
239
  return layerData.data;
240
240
  }
241
241
 
242
- /* global setInterval, URLSearchParams */
243
- async function _fetchMapDataset(dataset, accessToken) {
242
+ /* global clearInterval, setInterval, URLSearchParams */
243
+ async function _fetchMapDataset(dataset, accessToken, credentials) {
244
244
  // First fetch metadata
245
245
  const {connectionName: connection, source, type} = dataset;
246
246
  const {url, mapFormat} = await _fetchDataUrl({
247
- credentials: {accessToken},
247
+ credentials: {...credentials, accessToken},
248
248
  connection,
249
249
  source,
250
250
  type
@@ -263,15 +263,19 @@ async function _fetchMapDataset(dataset, accessToken) {
263
263
  return true;
264
264
  }
265
265
 
266
- async function fillInMapDatasets({datasets, publicToken}) {
267
- const promises = datasets.map(dataset => _fetchMapDataset(dataset, publicToken));
266
+ async function fillInMapDatasets({datasets, token}, credentials) {
267
+ const promises = datasets.map(dataset => _fetchMapDataset(dataset, token, credentials));
268
268
  return await Promise.all(promises);
269
269
  }
270
270
 
271
- export async function fetchMap({mapId, credentials, autoRefresh, onNewData}) {
272
- const localCreds = {...getDefaultCredentials(), ...credentials};
271
+ export async function fetchMap({cartoMapId, credentials, autoRefresh, onNewData}) {
272
+ const defaultCredentials = getDefaultCredentials();
273
+ const localCreds = {
274
+ ...(defaultCredentials.apiVersion === API_VERSIONS.V3 && defaultCredentials),
275
+ ...credentials
276
+ };
273
277
 
274
- log.assert(mapId, 'Must define map id');
278
+ log.assert(cartoMapId, `Must define CARTO map id: fetchMap({cartoMapId: 'XXXX-XXXX-XXXX'})`);
275
279
 
276
280
  log.assert(localCreds.apiVersion === API_VERSIONS.V3, 'Method only available for v3');
277
281
  log.assert(localCreds.apiBaseUrl, 'Must define apiBaseUrl');
@@ -285,21 +289,28 @@ export async function fetchMap({mapId, credentials, autoRefresh, onNewData}) {
285
289
  log.assert(autoRefresh > 0, '`autoRefresh` must be a positive number');
286
290
  }
287
291
 
288
- const url = `${localCreds.mapsUrl}/public/${mapId}`;
292
+ const url = `${localCreds.mapsUrl}/public/${cartoMapId}`;
289
293
  const map = await request({url});
290
294
 
291
295
  // Periodically check if the data has changed. Note that this
292
296
  // will not update when a map is published.
297
+ let stopAutoRefresh;
293
298
  if (autoRefresh) {
294
- setInterval(async () => {
295
- const changed = await fillInMapDatasets(map);
299
+ const intervalId = setInterval(async () => {
300
+ const changed = await fillInMapDatasets(map, credentials);
296
301
  if (changed.some(v => v === true)) {
297
302
  onNewData(parseMap(map));
298
303
  }
299
304
  }, autoRefresh * 1000);
305
+ stopAutoRefresh = () => {
306
+ clearInterval(intervalId);
307
+ };
300
308
  }
301
309
 
302
310
  // Mutates map.datasets so that dataset.data contains data
303
- await fillInMapDatasets(map);
304
- return parseMap(map);
311
+ await fillInMapDatasets(map, credentials);
312
+ return {
313
+ ...parseMap(map),
314
+ ...{stopAutoRefresh}
315
+ };
305
316
  }
@@ -20,7 +20,7 @@ export function parseMap(json) {
20
20
  description: json.description,
21
21
  createdAt: json.createdAt,
22
22
  updatedAt: json.updatedAt,
23
- mapState,
23
+ initialViewState: mapState,
24
24
  mapStyle,
25
25
  layers: extractTextLayers(layers.reverse()).map(({id, type, config, visualChannels}) => {
26
26
  log.assert(type in LAYER_MAP, `Unsupported layer type: ${type}`);
@@ -53,17 +53,20 @@ function extractTextLayers(layers) {
53
53
  {id, config: configRest, ...rest},
54
54
 
55
55
  // One layer per valid text label, with full opacity
56
- ...textLabel.filter(t => t.field).map(t => {
57
- return {
58
- id: `id-label-${t.field.name}`,
59
- config: {
60
- textLabel: t,
61
- ...configRest,
62
- visConfig: {...configRest.visConfig, opacity: 1}
63
- },
64
- ...rest
65
- };
66
- })
56
+ ...textLabel
57
+ .filter(t => t.field)
58
+ .map(t => {
59
+ return {
60
+ id: `${id}-label-${t.field.name}`,
61
+ config: {
62
+ textLabel: t,
63
+ ...configRest,
64
+ label: `${config.label}-label-${t.field.name}`,
65
+ visConfig: {...configRest.visConfig, opacity: 1}
66
+ },
67
+ ...rest
68
+ };
69
+ })
67
70
  ];
68
71
  })
69
72
  );
@@ -98,12 +101,6 @@ function createInteractionProps(interactionConfig) {
98
101
  }
99
102
 
100
103
  function mapProps(source, target, mapping) {
101
- if (Array.isArray(source)) {
102
- source = source[0];
103
- }
104
- if (!source) {
105
- return;
106
- }
107
104
  for (const sourceKey in mapping) {
108
105
  const sourceValue = source[sourceKey];
109
106
  const targetKey = mapping[sourceKey];
@@ -129,14 +126,8 @@ function createStyleProps(config, mapping) {
129
126
 
130
127
  /* eslint-disable complexity */
131
128
  function createChannelProps(visualChannels, type, config, data) {
132
- const {
133
- colorField,
134
- colorScale,
135
- sizeField,
136
- sizeScale,
137
- strokeColorField,
138
- strokeColorScale
139
- } = visualChannels;
129
+ const {colorField, colorScale, sizeField, sizeScale, strokeColorField, strokeColorScale} =
130
+ visualChannels;
140
131
  let {heightField, heightScale} = visualChannels;
141
132
  if (type === 'hexagonId') {
142
133
  heightField = sizeField;
package/src/config.js CHANGED
@@ -1,60 +1,29 @@
1
- import {API_VERSIONS, DEFAULT_MAPS_URL_FORMAT} from './api/maps-api-common';
1
+ import {API_VERSIONS} from './api/maps-api-common';
2
2
 
3
3
  export const defaultClassicCredentials = {
4
- username: 'public',
5
4
  apiKey: 'default_public',
6
5
  region: 'us',
7
- mapsUrl: null
6
+ username: 'public'
8
7
  };
9
8
 
10
- const defaultCloudNativeCredentials = {
11
- accessToken: null,
12
- apiBaseUrl: null,
13
- mapsUrl: null
9
+ export const defaultCloudNativeCredentials = {
10
+ apiBaseUrl: 'https://gcp-us-east1.api.carto.com'
14
11
  };
15
12
 
16
13
  let credentials = {};
17
14
 
18
15
  setDefaultCredentials({});
19
16
 
20
- export function setDefaultCredentials(opts) {
21
- const apiVersion = opts.apiVersion || API_VERSIONS.V2;
17
+ export function setDefaultCredentials({apiVersion, ...rest}) {
18
+ apiVersion = apiVersion || API_VERSIONS.V3;
22
19
 
23
20
  switch (apiVersion) {
24
21
  case API_VERSIONS.V1:
25
- opts.mapsUrl = opts.mapsUrl || DEFAULT_MAPS_URL_FORMAT[apiVersion];
26
- credentials = {
27
- apiVersion,
28
- ...defaultClassicCredentials,
29
- ...opts
30
- };
31
- break;
32
-
33
22
  case API_VERSIONS.V2:
34
- opts.mapsUrl = opts.mapsUrl || DEFAULT_MAPS_URL_FORMAT[apiVersion];
35
- credentials = {
36
- apiVersion,
37
- ...defaultClassicCredentials,
38
- ...opts
39
- };
40
-
23
+ credentials = {apiVersion, ...defaultClassicCredentials, ...rest};
41
24
  break;
42
25
  case API_VERSIONS.V3:
43
- if (!opts.apiBaseUrl) {
44
- throw new Error(
45
- `API version ${
46
- API_VERSIONS.V3
47
- } requires to define apiBaseUrl at credentials. Go to https://app.carto.com to get your apiBaseUrl.`
48
- );
49
- }
50
-
51
- const apiBaseUrl = opts.apiBaseUrl || defaultCloudNativeCredentials.apiBaseUrl;
52
- opts.mapsUrl = opts.mapsUrl || buildMapsUrlFromBase(apiBaseUrl);
53
- credentials = {
54
- apiVersion,
55
- ...defaultCloudNativeCredentials,
56
- ...opts
57
- };
26
+ credentials = {apiVersion, ...defaultCloudNativeCredentials, ...rest};
58
27
  break;
59
28
  default:
60
29
  throw new Error(`Invalid API version ${apiVersion}. Use API_VERSIONS enum.`);
package/src/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  export {getDefaultCredentials, setDefaultCredentials} from './config.js';
2
- export {default as CartoSQLLayer} from './layers/carto-sql-layer';
3
- export {default as CartoBQTilerLayer} from './layers/carto-bqtiler-layer';
4
2
  export {default as CartoLayer} from './layers/carto-layer';
5
3
  export {default as BASEMAP} from './basemap';
6
4
  export {default as colorBins} from './style/color-bins-style';
@@ -1,8 +1,8 @@
1
1
  import {CompositeLayer, log} from '@deck.gl/core';
2
2
  import {MVTLayer} from '@deck.gl/geo-layers';
3
3
  import {GeoJsonLayer} from '@deck.gl/layers';
4
- import {getData, getDataV2, API_VERSIONS} from '../api';
5
- import {MAP_TYPES} from '../api/maps-api-common';
4
+ import {fetchLayerData, getDataV2, API_VERSIONS} from '../api';
5
+ import {FORMATS, MAP_TYPES} from '../api/maps-api-common';
6
6
  import {getDefaultCredentials} from '../config';
7
7
 
8
8
  const defaultProps = {
@@ -12,6 +12,7 @@ const defaultProps = {
12
12
  type: null,
13
13
  onDataLoad: {type: 'function', value: data => {}, compare: false},
14
14
  onDataError: {type: 'function', value: null, compare: false, optional: true},
15
+ uniqueIdProperty: 'cartodb_id',
15
16
 
16
17
  // override carto credentials for the layer, set to null to read from default
17
18
  credentials: null,
@@ -22,6 +23,9 @@ const defaultProps = {
22
23
  // (String, required): connection name at CARTO platform
23
24
  connection: null,
24
25
 
26
+ // (String, optional): format of data
27
+ format: null,
28
+
25
29
  // (String, optional): name of the `geo_column` in the CARTO platform. Use this override the default column ('geom'), from which the geometry information should be fetched.
26
30
  geoColumn: null,
27
31
 
@@ -93,29 +97,19 @@ export default class CartoLayer extends CompositeLayer {
93
97
 
94
98
  async _updateData() {
95
99
  try {
96
- const {type, data: source, connection, credentials, geoColumn, columns} = this.props;
100
+ const {type, data: source, credentials, ...rest} = this.props;
97
101
  const localConfig = {...getDefaultCredentials(), ...credentials};
98
102
  const {apiVersion} = localConfig;
99
103
 
100
- let data;
101
-
102
- if (apiVersion === API_VERSIONS.V3) {
103
- data = await getData({
104
- type,
105
- source,
106
- connection,
107
- credentials,
108
- geoColumn,
109
- columns
110
- });
111
- } else if (apiVersion === API_VERSIONS.V1 || apiVersion === API_VERSIONS.V2) {
112
- data = await getDataV2({type, source, credentials});
104
+ let result;
105
+ if (apiVersion === API_VERSIONS.V1 || apiVersion === API_VERSIONS.V2) {
106
+ result = {data: await getDataV2({type, source, credentials})};
113
107
  } else {
114
- log.assert(`Unknow apiVersion ${apiVersion}. Use API_VERSIONS enum.`);
108
+ result = await fetchLayerData({type, source, credentials, ...rest});
115
109
  }
116
110
 
117
- this.setState({data, apiVersion});
118
- this.props.onDataLoad(data);
111
+ this.setState({...result, apiVersion});
112
+ this.props.onDataLoad(result.data);
119
113
  } catch (err) {
120
114
  if (this.props.onDataError) {
121
115
  this.props.onDataError(err);
@@ -126,8 +120,7 @@ export default class CartoLayer extends CompositeLayer {
126
120
  }
127
121
 
128
122
  renderLayers() {
129
- const {data, apiVersion} = this.state;
130
- const {type} = this.props;
123
+ const {data, format, apiVersion} = this.state;
131
124
 
132
125
  if (!data) return null;
133
126
 
@@ -138,14 +131,15 @@ export default class CartoLayer extends CompositeLayer {
138
131
  if (
139
132
  apiVersion === API_VERSIONS.V1 ||
140
133
  apiVersion === API_VERSIONS.V2 ||
141
- type === MAP_TYPES.TILESET
134
+ format === FORMATS.TILEJSON
142
135
  ) {
143
136
  layer = MVTLayer;
144
137
  } else {
145
138
  layer = GeoJsonLayer;
146
139
  }
147
140
 
148
- const props = {...this.props};
141
+ const {uniqueIdProperty} = defaultProps;
142
+ const props = {uniqueIdProperty, ...this.props};
149
143
  delete props.data;
150
144
 
151
145
  // eslint-disable-next-line new-cap
@@ -10,11 +10,9 @@ export default function colorBins({
10
10
  }) {
11
11
  assert(Array.isArray(domain), 'Expected "domain" to be an array of numbers');
12
12
 
13
- const palette = typeof colors === 'string' ? getPalette(colors, domain.length) : colors;
13
+ const palette = typeof colors === 'string' ? getPalette(colors, domain.length + 1) : colors;
14
14
 
15
- const color = scaleThreshold()
16
- .domain(domain)
17
- .range(palette);
15
+ const color = scaleThreshold().domain(domain).range(palette);
18
16
 
19
17
  return d => {
20
18
  const value = getAttrValue(attr, d);
@@ -10,10 +10,8 @@ export default function colorContinuous({
10
10
  }) {
11
11
  assert(Array.isArray(domain), 'Expected "domain" to be an array of numbers');
12
12
 
13
- const palette = typeof colors === 'string' ? getPalette(colors) : colors;
14
- const color = scaleLinear()
15
- .domain(domain)
16
- .range(palette);
13
+ const palette = typeof colors === 'string' ? getPalette(colors, domain.length) : colors;
14
+ const color = scaleLinear().domain(domain).range(palette);
17
15
 
18
16
  return d => {
19
17
  const value = getAttrValue(attr, d);
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
-
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
-
16
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
-
18
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
19
-
20
- var _core = require("@deck.gl/core");
21
-
22
- var _cartoLayer = _interopRequireDefault(require("./carto-layer"));
23
-
24
- var _api = require("../api");
25
-
26
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
27
-
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
29
-
30
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
31
-
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
33
-
34
- var defaultProps = _objectSpread(_objectSpread({}, _cartoLayer.default.defaultProps), {}, {
35
- type: _api.MAP_TYPES.TILESET
36
- });
37
-
38
- var CartoBQTilerLayer = function (_CartoLayer) {
39
- (0, _inherits2.default)(CartoBQTilerLayer, _CartoLayer);
40
-
41
- var _super = _createSuper(CartoBQTilerLayer);
42
-
43
- function CartoBQTilerLayer() {
44
- var _this;
45
-
46
- (0, _classCallCheck2.default)(this, CartoBQTilerLayer);
47
-
48
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
- args[_key] = arguments[_key];
50
- }
51
-
52
- _this = _super.call.apply(_super, [this].concat(args));
53
-
54
- _core.log.warn('CartoBQTilerLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.TILESET and apiVersion=API_VERSIONS.V2')();
55
-
56
- return _this;
57
- }
58
-
59
- return CartoBQTilerLayer;
60
- }(_cartoLayer.default);
61
-
62
- exports.default = CartoBQTilerLayer;
63
- CartoBQTilerLayer.layerName = 'CartoBQTilerLayer';
64
- CartoBQTilerLayer.defaultProps = defaultProps;
65
- //# sourceMappingURL=carto-bqtiler-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/layers/carto-bqtiler-layer.js"],"names":["defaultProps","CartoLayer","type","MAP_TYPES","TILESET","CartoBQTilerLayer","args","log","warn","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,mCACbC,oBAAWD,YADE;AAEhBE,EAAAA,IAAI,EAAEC,eAAUC;AAFA,EAAlB;;IAKqBC,iB;;;;;AACnB,+BAAqB;AAAA;;AAAA;;AAAA,sCAANC,IAAM;AAANA,MAAAA,IAAM;AAAA;;AACnB,oDAASA,IAAT;;AAEAC,cAAIC,IAAJ,CACE,iIADF;;AAHmB;AAMpB;;;EAP4CP,mB;;;AAU/CI,iBAAiB,CAACI,SAAlB,GAA8B,mBAA9B;AACAJ,iBAAiB,CAACL,YAAlB,GAAiCA,YAAjC","sourcesContent":["import {log} from '@deck.gl/core';\nimport CartoLayer from './carto-layer';\nimport {MAP_TYPES} from '../api';\n\nconst defaultProps = {\n ...CartoLayer.defaultProps,\n type: MAP_TYPES.TILESET\n};\n\nexport default class CartoBQTilerLayer extends CartoLayer {\n constructor(...args) {\n super(...args);\n\n log.warn(\n 'CartoBQTilerLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.TILESET and apiVersion=API_VERSIONS.V2'\n )();\n }\n}\n\nCartoBQTilerLayer.layerName = 'CartoBQTilerLayer';\nCartoBQTilerLayer.defaultProps = defaultProps;\n"],"file":"carto-bqtiler-layer.js"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
-
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
-
16
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
-
18
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
19
-
20
- var _core = require("@deck.gl/core");
21
-
22
- var _cartoLayer = _interopRequireDefault(require("./carto-layer"));
23
-
24
- var _api = require("../api");
25
-
26
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
27
-
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
29
-
30
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
31
-
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
33
-
34
- var defaultProps = _objectSpread(_objectSpread({}, _cartoLayer.default.defaultProps), {}, {
35
- type: _api.MAP_TYPES.QUERY,
36
- uniqueIdProperty: 'cartodb_id'
37
- });
38
-
39
- var CartoSQLLayer = function (_CartoLayer) {
40
- (0, _inherits2.default)(CartoSQLLayer, _CartoLayer);
41
-
42
- var _super = _createSuper(CartoSQLLayer);
43
-
44
- function CartoSQLLayer() {
45
- var _this;
46
-
47
- (0, _classCallCheck2.default)(this, CartoSQLLayer);
48
-
49
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50
- args[_key] = arguments[_key];
51
- }
52
-
53
- _this = _super.call.apply(_super, [this].concat(args));
54
-
55
- _core.log.warn('CartoSQLLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.QUERY and apiVersion=API_VERSIONS.V2')();
56
-
57
- return _this;
58
- }
59
-
60
- return CartoSQLLayer;
61
- }(_cartoLayer.default);
62
-
63
- exports.default = CartoSQLLayer;
64
- CartoSQLLayer.layerName = 'CartoSQLLayer';
65
- CartoSQLLayer.defaultProps = defaultProps;
66
- //# sourceMappingURL=carto-sql-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/layers/carto-sql-layer.js"],"names":["defaultProps","CartoLayer","type","MAP_TYPES","QUERY","uniqueIdProperty","CartoSQLLayer","args","log","warn","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,mCACbC,oBAAWD,YADE;AAEhBE,EAAAA,IAAI,EAAEC,eAAUC,KAFA;AAGhBC,EAAAA,gBAAgB,EAAE;AAHF,EAAlB;;IAMqBC,a;;;;;AACnB,2BAAqB;AAAA;;AAAA;;AAAA,sCAANC,IAAM;AAANA,MAAAA,IAAM;AAAA;;AACnB,oDAASA,IAAT;;AAEAC,cAAIC,IAAJ,CACE,2HADF;;AAHmB;AAMpB;;;EAPwCR,mB;;;AAU3CK,aAAa,CAACI,SAAd,GAA0B,eAA1B;AACAJ,aAAa,CAACN,YAAd,GAA6BA,YAA7B","sourcesContent":["import {log} from '@deck.gl/core';\nimport CartoLayer from './carto-layer';\nimport {MAP_TYPES} from '../api';\n\nconst defaultProps = {\n ...CartoLayer.defaultProps,\n type: MAP_TYPES.QUERY,\n uniqueIdProperty: 'cartodb_id'\n};\n\nexport default class CartoSQLLayer extends CartoLayer {\n constructor(...args) {\n super(...args);\n\n log.warn(\n 'CartoSQLLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.QUERY and apiVersion=API_VERSIONS.V2'\n )();\n }\n}\n\nCartoSQLLayer.layerName = 'CartoSQLLayer';\nCartoSQLLayer.defaultProps = defaultProps;\n"],"file":"carto-sql-layer.js"}
@@ -1,16 +0,0 @@
1
- import { log } from '@deck.gl/core';
2
- import CartoLayer from './carto-layer';
3
- import { MAP_TYPES } from '../api';
4
- const defaultProps = { ...CartoLayer.defaultProps,
5
- type: MAP_TYPES.TILESET
6
- };
7
- export default class CartoBQTilerLayer extends CartoLayer {
8
- constructor(...args) {
9
- super(...args);
10
- log.warn('CartoBQTilerLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.TILESET and apiVersion=API_VERSIONS.V2')();
11
- }
12
-
13
- }
14
- CartoBQTilerLayer.layerName = 'CartoBQTilerLayer';
15
- CartoBQTilerLayer.defaultProps = defaultProps;
16
- //# sourceMappingURL=carto-bqtiler-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/layers/carto-bqtiler-layer.js"],"names":["log","CartoLayer","MAP_TYPES","defaultProps","type","TILESET","CartoBQTilerLayer","constructor","args","warn","layerName"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,eAAlB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAAQC,SAAR,QAAwB,QAAxB;AAEA,MAAMC,YAAY,GAAG,EACnB,GAAGF,UAAU,CAACE,YADK;AAEnBC,EAAAA,IAAI,EAAEF,SAAS,CAACG;AAFG,CAArB;AAKA,eAAe,MAAMC,iBAAN,SAAgCL,UAAhC,CAA2C;AACxDM,EAAAA,WAAW,CAAC,GAAGC,IAAJ,EAAU;AACnB,UAAM,GAAGA,IAAT;AAEAR,IAAAA,GAAG,CAACS,IAAJ,CACE,iIADF;AAGD;;AAPuD;AAU1DH,iBAAiB,CAACI,SAAlB,GAA8B,mBAA9B;AACAJ,iBAAiB,CAACH,YAAlB,GAAiCA,YAAjC","sourcesContent":["import {log} from '@deck.gl/core';\nimport CartoLayer from './carto-layer';\nimport {MAP_TYPES} from '../api';\n\nconst defaultProps = {\n ...CartoLayer.defaultProps,\n type: MAP_TYPES.TILESET\n};\n\nexport default class CartoBQTilerLayer extends CartoLayer {\n constructor(...args) {\n super(...args);\n\n log.warn(\n 'CartoBQTilerLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.TILESET and apiVersion=API_VERSIONS.V2'\n )();\n }\n}\n\nCartoBQTilerLayer.layerName = 'CartoBQTilerLayer';\nCartoBQTilerLayer.defaultProps = defaultProps;\n"],"file":"carto-bqtiler-layer.js"}
@@ -1,17 +0,0 @@
1
- import { log } from '@deck.gl/core';
2
- import CartoLayer from './carto-layer';
3
- import { MAP_TYPES } from '../api';
4
- const defaultProps = { ...CartoLayer.defaultProps,
5
- type: MAP_TYPES.QUERY,
6
- uniqueIdProperty: 'cartodb_id'
7
- };
8
- export default class CartoSQLLayer extends CartoLayer {
9
- constructor(...args) {
10
- super(...args);
11
- log.warn('CartoSQLLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.QUERY and apiVersion=API_VERSIONS.V2')();
12
- }
13
-
14
- }
15
- CartoSQLLayer.layerName = 'CartoSQLLayer';
16
- CartoSQLLayer.defaultProps = defaultProps;
17
- //# sourceMappingURL=carto-sql-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/layers/carto-sql-layer.js"],"names":["log","CartoLayer","MAP_TYPES","defaultProps","type","QUERY","uniqueIdProperty","CartoSQLLayer","constructor","args","warn","layerName"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,eAAlB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAAQC,SAAR,QAAwB,QAAxB;AAEA,MAAMC,YAAY,GAAG,EACnB,GAAGF,UAAU,CAACE,YADK;AAEnBC,EAAAA,IAAI,EAAEF,SAAS,CAACG,KAFG;AAGnBC,EAAAA,gBAAgB,EAAE;AAHC,CAArB;AAMA,eAAe,MAAMC,aAAN,SAA4BN,UAA5B,CAAuC;AACpDO,EAAAA,WAAW,CAAC,GAAGC,IAAJ,EAAU;AACnB,UAAM,GAAGA,IAAT;AAEAT,IAAAA,GAAG,CAACU,IAAJ,CACE,2HADF;AAGD;;AAPmD;AAUtDH,aAAa,CAACI,SAAd,GAA0B,eAA1B;AACAJ,aAAa,CAACJ,YAAd,GAA6BA,YAA7B","sourcesContent":["import {log} from '@deck.gl/core';\nimport CartoLayer from './carto-layer';\nimport {MAP_TYPES} from '../api';\n\nconst defaultProps = {\n ...CartoLayer.defaultProps,\n type: MAP_TYPES.QUERY,\n uniqueIdProperty: 'cartodb_id'\n};\n\nexport default class CartoSQLLayer extends CartoLayer {\n constructor(...args) {\n super(...args);\n\n log.warn(\n 'CartoSQLLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.QUERY and apiVersion=API_VERSIONS.V2'\n )();\n }\n}\n\nCartoSQLLayer.layerName = 'CartoSQLLayer';\nCartoSQLLayer.defaultProps = defaultProps;\n"],"file":"carto-sql-layer.js"}
@@ -1,21 +0,0 @@
1
- import {log} from '@deck.gl/core';
2
- import CartoLayer from './carto-layer';
3
- import {MAP_TYPES} from '../api';
4
-
5
- const defaultProps = {
6
- ...CartoLayer.defaultProps,
7
- type: MAP_TYPES.TILESET
8
- };
9
-
10
- export default class CartoBQTilerLayer extends CartoLayer {
11
- constructor(...args) {
12
- super(...args);
13
-
14
- log.warn(
15
- 'CartoBQTilerLayer will be removed in future versions. Use CartoLayer with type=MAP_TYPES.TILESET and apiVersion=API_VERSIONS.V2'
16
- )();
17
- }
18
- }
19
-
20
- CartoBQTilerLayer.layerName = 'CartoBQTilerLayer';
21
- CartoBQTilerLayer.defaultProps = defaultProps;