@deck.gl/carto 9.0.0-alpha.3 → 9.0.0-alpha.4

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 (36) hide show
  1. package/dist/cartoRasterTile-worker.js +1 -1
  2. package/dist/cartoSpatialTile-worker.js +1 -1
  3. package/dist/cartoVectorTile-worker.js +1 -1
  4. package/dist/dist.dev.js +33 -25
  5. package/dist/es5/api/fetch-map.js +16 -8
  6. package/dist/es5/api/fetch-map.js.map +1 -1
  7. package/dist/es5/layers/schema/carto-raster-tile-loader.js +1 -1
  8. package/dist/es5/layers/schema/carto-spatial-tile-loader.js +1 -1
  9. package/dist/es5/layers/schema/carto-vector-tile-loader.js +1 -1
  10. package/dist/es5/layers/utils.js +3 -3
  11. package/dist/es5/layers/utils.js.map +1 -1
  12. package/dist/es5/layers/vector-tile-layer.js +1 -1
  13. package/dist/es5/layers/vector-tile-layer.js.map +1 -1
  14. package/dist/es5/sources/boundary-query-source.js.map +1 -1
  15. package/dist/esm/api/fetch-map.js +13 -4
  16. package/dist/esm/api/fetch-map.js.map +1 -1
  17. package/dist/esm/layers/schema/carto-raster-tile-loader.js +1 -1
  18. package/dist/esm/layers/schema/carto-spatial-tile-loader.js +1 -1
  19. package/dist/esm/layers/schema/carto-vector-tile-loader.js +1 -1
  20. package/dist/esm/layers/utils.js +4 -3
  21. package/dist/esm/layers/utils.js.map +1 -1
  22. package/dist/esm/layers/vector-tile-layer.js +1 -1
  23. package/dist/esm/layers/vector-tile-layer.js.map +1 -1
  24. package/dist/esm/sources/boundary-query-source.js.map +1 -1
  25. package/dist.min.js +40 -40
  26. package/package.json +2 -2
  27. package/src/api/fetch-map.ts +9 -2
  28. package/src/layers/utils.ts +4 -2
  29. package/src/layers/vector-tile-layer.ts +1 -1
  30. package/src/sources/boundary-query-source.ts +1 -1
  31. package/typed/api/fetch-map.d.ts.map +1 -1
  32. package/typed/layers/utils.d.ts.map +1 -1
  33. package/typed/sources/boundary-query-source.d.ts +1 -1
  34. package/typed/sources/boundary-query-source.d.ts.map +1 -1
  35. package/LICENSE +0 -19
  36. package/src/.DS_Store +0 -0
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": "9.0.0-alpha.3",
5
+ "version": "9.0.0-alpha.4",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -66,5 +66,5 @@
66
66
  "@deck.gl/layers": "^8.0.0",
67
67
  "@loaders.gl/core": "4.0.3"
68
68
  },
69
- "gitHead": "51dfb88f9168ccf478d01b28a2c5ada7bd8281c7"
69
+ "gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
70
70
  }
@@ -113,7 +113,7 @@ async function _fetchTilestats(
113
113
  accessToken: string,
114
114
  apiBaseUrl: string
115
115
  ) {
116
- const {connectionName: connection, data, id, source, type} = dataset;
116
+ const {connectionName: connection, data, id, source, type, queryParameters} = dataset;
117
117
  const errorContext: APIErrorContext = {requestType: 'Tile stats', connection, type, source};
118
118
  if (!('tilestats' in data)) {
119
119
  throw new CartoAPIError(new Error(`Invalid dataset for tilestats: ${id}`), errorContext);
@@ -129,10 +129,17 @@ async function _fetchTilestats(
129
129
  }
130
130
 
131
131
  const headers = {Authorization: `Bearer ${accessToken}`};
132
+ const parameters: Record<string, string> = {};
133
+ if (type === 'query') {
134
+ parameters.q = source;
135
+ if (queryParameters) {
136
+ parameters.queryParameters = JSON.stringify(queryParameters);
137
+ }
138
+ }
132
139
  const stats = await requestWithParameters({
133
140
  baseUrl,
134
141
  headers,
135
- parameters: type === 'query' ? {q: source} : {},
142
+ parameters,
136
143
  errorContext
137
144
  });
138
145
 
@@ -1,3 +1,4 @@
1
+ import {log} from '@deck.gl/core';
1
2
  import {Tile as PropertiesTile} from './schema/carto-properties-tile';
2
3
  import {Tile as VectorTile} from './schema/carto-tile';
3
4
  import {_deepEqual as deepEqual} from '@deck.gl/core';
@@ -19,9 +20,10 @@ export function mergeBoundaryData(geometry: VectorTile, properties: PropertiesTi
19
20
  const mapping = {};
20
21
  for (const {geoid, ...rest} of properties.properties) {
21
22
  if (geoid in mapping) {
22
- throw new Error(`Duplicate geoid key in mapping: ${geoid}`);
23
+ log.warn(`Duplicate geoid key in boundary mapping, using first occurance`)();
24
+ } else {
25
+ mapping[geoid] = rest;
23
26
  }
24
- mapping[geoid] = rest;
25
27
  }
26
28
 
27
29
  for (const type of ['points', 'lines', 'polygons']) {
@@ -104,7 +104,7 @@ export default class VectorTileLayer<ExtraProps extends {} = {}> extends MVTLaye
104
104
  const [geometry, attributes] = await Promise.all([geometryFetch, attributesFetch]);
105
105
  if (!geometry) return null;
106
106
 
107
- return mergeBoundaryData(geometry, attributes);
107
+ return attributes ? mergeBoundaryData(geometry, attributes) : geometry;
108
108
  }
109
109
 
110
110
  renderSubLayers(
@@ -6,7 +6,7 @@ export type BoundaryQuerySourceOptions = SourceOptions & {
6
6
  boundaryId: string;
7
7
  matchingColumn?: string;
8
8
  sqlQuery: string;
9
- queryParameters: QueryParameters;
9
+ queryParameters?: QueryParameters;
10
10
  };
11
11
  type UrlParameters = {
12
12
  boundaryId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-map.d.ts","sourceRoot":"","sources":["../../src/api/fetch-map.ts"],"names":[],"mappings":"AAiMA,oBAAY,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAGF,wBAAsB,QAAQ,CAAC,EAC7B,UAAiC,EACjC,UAAU,EACV,QAAyB,EACzB,OAAY,EACZ,OAAO,EACP,WAAW,EACX,SAAS,EACV,EAAE,eAAe;4BAmBY,IAAI;;;;;;;;;;GAuDjC"}
1
+ {"version":3,"file":"fetch-map.d.ts","sourceRoot":"","sources":["../../src/api/fetch-map.ts"],"names":[],"mappings":"AAwMA,oBAAY,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAGF,wBAAsB,QAAQ,CAAC,EAC7B,UAAiC,EACjC,UAAU,EACV,QAAyB,EACzB,OAAY,EACZ,OAAO,EACP,WAAW,EACX,SAAS,EACV,EAAE,eAAe;4BAmBY,IAAI;;;;;;;;;;GAuDjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/layers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,IAAI,cAAc,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAC,IAAI,IAAI,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAO7E;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,GAAG,UAAU,CAkD9F;AAED,eAAO,MAAM,gBAAgB;;;sBAGT,cAAc;;;CASjC,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/layers/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,IAAI,cAAc,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAC,IAAI,IAAI,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAO7E;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,GAAG,UAAU,CAmD9F;AAED,eAAO,MAAM,gBAAgB;;;sBAGT,cAAc;;;CASjC,CAAC"}
@@ -4,7 +4,7 @@ export declare type BoundaryQuerySourceOptions = SourceOptions & {
4
4
  boundaryId: string;
5
5
  matchingColumn?: string;
6
6
  sqlQuery: string;
7
- queryParameters: QueryParameters;
7
+ queryParameters?: QueryParameters;
8
8
  };
9
9
  export declare const boundaryQuerySource: (options: BoundaryQuerySourceOptions) => Promise<TilejsonResult>;
10
10
  //# sourceMappingURL=boundary-query-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boundary-query-source.d.ts","sourceRoot":"","sources":["../../src/sources/boundary-query-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAEvC,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAE3D,oBAAY,0BAA0B,GAAG,aAAa,GAAG;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAQF,eAAO,MAAM,mBAAmB,YACrB,0BAA0B,KAClC,QAAQ,cAAc,CAWxB,CAAC"}
1
+ {"version":3,"file":"boundary-query-source.d.ts","sourceRoot":"","sources":["../../src/sources/boundary-query-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAEvC,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAE3D,oBAAY,0BAA0B,GAAG,aAAa,GAAG;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAQF,eAAO,MAAM,mBAAmB,YACrB,0BAA0B,KAClC,QAAQ,cAAc,CAWxB,CAAC"}
package/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright Vis.gl contributors.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
package/src/.DS_Store DELETED
Binary file