@deck.gl/carto 9.0.0-beta.7 → 9.0.0-beta.9

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 (75) hide show
  1. package/dist/api/common.d.ts +1 -1
  2. package/dist/api/common.js +1 -1
  3. package/dist/api/fetch-map.d.ts.map +1 -1
  4. package/dist/api/fetch-map.js +8 -3
  5. package/dist/api/request-with-parameters.d.ts.map +1 -1
  6. package/dist/api/request-with-parameters.js +7 -3
  7. package/dist/cartoRasterTile-worker.js +16 -54
  8. package/dist/cartoSpatialTile-worker.js +12 -47
  9. package/dist/cartoVectorTile-worker.js +12 -47
  10. package/dist/constants.d.ts +5 -0
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/constants.js +4 -0
  13. package/dist/dist.dev.js +100 -100
  14. package/dist/index.cjs +70 -43
  15. package/dist/index.cjs.map +4 -4
  16. package/dist/layers/h3-tile-layer.d.ts.map +1 -1
  17. package/dist/layers/h3-tile-layer.js +3 -1
  18. package/dist/layers/quadbin-tile-layer.d.ts.map +1 -1
  19. package/dist/layers/quadbin-tile-layer.js +3 -1
  20. package/dist/layers/raster-layer.d.ts.map +1 -1
  21. package/dist/layers/raster-layer.js +5 -6
  22. package/dist/layers/raster-tile-layer.d.ts.map +1 -1
  23. package/dist/layers/raster-tile-layer.js +3 -1
  24. package/dist/layers/schema/carto-raster-tile-loader.d.ts +2 -2
  25. package/dist/layers/schema/carto-raster-tile-loader.d.ts.map +1 -1
  26. package/dist/layers/schema/carto-raster-tile-loader.js +3 -4
  27. package/dist/layers/schema/carto-raster-tile.d.ts.map +1 -1
  28. package/dist/layers/schema/carto-raster-tile.js +2 -4
  29. package/dist/layers/schema/carto-spatial-tile-loader.js +1 -1
  30. package/dist/layers/schema/carto-vector-tile-loader.js +1 -1
  31. package/dist/layers/spatial-index-tile-layer.d.ts.map +1 -1
  32. package/dist/layers/spatial-index-tile-layer.js +4 -1
  33. package/dist/layers/vector-tile-layer.d.ts +4 -4
  34. package/dist/layers/vector-tile-layer.d.ts.map +1 -1
  35. package/dist/layers/vector-tile-layer.js +3 -1
  36. package/dist/sources/h3-query-source.d.ts.map +1 -1
  37. package/dist/sources/h3-query-source.js +2 -1
  38. package/dist/sources/h3-table-source.d.ts.map +1 -1
  39. package/dist/sources/h3-table-source.js +2 -4
  40. package/dist/sources/quadbin-query-source.d.ts.map +1 -1
  41. package/dist/sources/quadbin-query-source.js +2 -1
  42. package/dist/sources/quadbin-table-source.d.ts.map +1 -1
  43. package/dist/sources/quadbin-table-source.js +2 -4
  44. package/dist/sources/types.d.ts +38 -6
  45. package/dist/sources/types.d.ts.map +1 -1
  46. package/dist/sources/vector-query-source.d.ts +2 -4
  47. package/dist/sources/vector-query-source.d.ts.map +1 -1
  48. package/dist/sources/vector-query-source.js +8 -2
  49. package/dist/sources/vector-table-source.d.ts +2 -2
  50. package/dist/sources/vector-table-source.d.ts.map +1 -1
  51. package/dist/sources/vector-table-source.js +8 -2
  52. package/dist/utils.d.ts.map +1 -1
  53. package/dist/utils.js +5 -1
  54. package/dist.min.js +7 -7
  55. package/package.json +10 -10
  56. package/src/api/common.ts +1 -1
  57. package/src/api/fetch-map.ts +8 -3
  58. package/src/api/request-with-parameters.ts +16 -5
  59. package/src/constants.ts +5 -0
  60. package/src/layers/h3-tile-layer.ts +3 -1
  61. package/src/layers/quadbin-tile-layer.ts +3 -1
  62. package/src/layers/raster-layer.ts +7 -12
  63. package/src/layers/raster-tile-layer.ts +3 -1
  64. package/src/layers/schema/carto-raster-tile-loader.ts +5 -5
  65. package/src/layers/schema/carto-raster-tile.ts +3 -4
  66. package/src/layers/spatial-index-tile-layer.ts +4 -1
  67. package/src/layers/vector-tile-layer.ts +10 -6
  68. package/src/sources/h3-query-source.ts +2 -1
  69. package/src/sources/h3-table-source.ts +2 -6
  70. package/src/sources/quadbin-query-source.ts +2 -1
  71. package/src/sources/quadbin-table-source.ts +2 -6
  72. package/src/sources/types.ts +41 -6
  73. package/src/sources/vector-query-source.ts +22 -6
  74. package/src/sources/vector-table-source.ts +21 -3
  75. package/src/utils.ts +5 -1
package/dist/dist.dev.js CHANGED
@@ -9267,14 +9267,12 @@ var __exports__ = (() => {
9267
9267
  };
9268
9268
  var TileReader = class {
9269
9269
  static read(pbf, end) {
9270
- return pbf.readFields(TileReader._readField, { blockWidth: 0, blockHeight: 0, bands: [] }, end);
9270
+ return pbf.readFields(TileReader._readField, { blockSize: 0, bands: [] }, end);
9271
9271
  }
9272
9272
  static _readField(tag, obj, pbf) {
9273
9273
  if (tag === 1)
9274
- obj.blockWidth = pbf.readVarint();
9274
+ obj.blockSize = pbf.readVarint();
9275
9275
  else if (tag === 2)
9276
- obj.blockHeight = pbf.readVarint();
9277
- else if (tag === 3)
9278
9276
  obj.bands.push(BandReader.read(pbf, pbf.readVarint() + pbf.pos));
9279
9277
  }
9280
9278
  };
@@ -9322,7 +9320,11 @@ var __exports__ = (() => {
9322
9320
  }
9323
9321
  return unknown;
9324
9322
  };
9325
- scale.copy = () => scaleIdentity().unknown(unknown);
9323
+ scale.copy = () => {
9324
+ const scaleCopy = scaleIdentity();
9325
+ scaleCopy.unknown(unknown);
9326
+ return scaleCopy;
9327
+ };
9326
9328
  return scale;
9327
9329
  }
9328
9330
 
@@ -9350,14 +9352,13 @@ var __exports__ = (() => {
9350
9352
  function parseCartoRasterTile(arrayBuffer, options) {
9351
9353
  if (!arrayBuffer)
9352
9354
  return null;
9353
- const tile = parsePbf(arrayBuffer, TileReader);
9354
- const { bands, blockHeight, blockWidth } = tile;
9355
+ const { bands, blockSize } = parsePbf(arrayBuffer, TileReader);
9355
9356
  const numericProps = {};
9356
9357
  for (let i = 0; i < bands.length; i++) {
9357
9358
  const { name, data } = bands[i];
9358
9359
  numericProps[name] = data;
9359
9360
  }
9360
- return { blockWidth, blockHeight, cells: { numericProps, properties: [] } };
9361
+ return { blockSize, cells: { numericProps, properties: [] } };
9361
9362
  }
9362
9363
  var carto_raster_tile_loader_default = CartoRasterTileLoader;
9363
9364
 
@@ -9710,11 +9711,21 @@ var __exports__ = (() => {
9710
9711
 
9711
9712
  // src/layers/spatial-index-tile-layer.ts
9712
9713
  var import_geo_layers2 = __toESM(require_geo_layers(), 1);
9714
+
9715
+ // src/constants.ts
9716
+ var DEFAULT_TILE_SIZE = 512;
9717
+ var DEFAULT_TILE_RESOLUTION = 0.5;
9718
+ var DEFAULT_AGGREGATION_RES_LEVEL_H3 = 4;
9719
+ var DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN = 6;
9720
+
9721
+ // src/layers/spatial-index-tile-layer.ts
9713
9722
  (0, import_core2.registerLoaders)([carto_raster_tile_loader_default, carto_spatial_tile_loader_default]);
9714
9723
  function isFeatureIdDefined(value) {
9715
9724
  return value !== void 0 && value !== null && value !== "";
9716
9725
  }
9717
- var defaultProps = {};
9726
+ var defaultProps = {
9727
+ tileSize: DEFAULT_TILE_SIZE
9728
+ };
9718
9729
  var SpatialIndexTileLayer = class extends import_geo_layers2.TileLayer {
9719
9730
  _updateAutoHighlight(info) {
9720
9731
  const { hoveredFeatureId } = this.state;
@@ -9843,7 +9854,8 @@ var __exports__ = (() => {
9843
9854
  });
9844
9855
  };
9845
9856
  var defaultProps2 = {
9846
- data: TilejsonPropType
9857
+ data: TilejsonPropType,
9858
+ tileSize: DEFAULT_TILE_SIZE
9847
9859
  };
9848
9860
  var H3TileLayer = class extends import_core5.CompositeLayer {
9849
9861
  initializeState() {
@@ -10154,7 +10166,8 @@ var __exports__ = (() => {
10154
10166
  });
10155
10167
  };
10156
10168
  var defaultProps5 = {
10157
- data: TilejsonPropType
10169
+ data: TilejsonPropType,
10170
+ tileSize: DEFAULT_TILE_SIZE
10158
10171
  };
10159
10172
  var QuadbinTileLayer = class extends import_core7.CompositeLayer {
10160
10173
  getLoadOptions() {
@@ -10306,7 +10319,7 @@ void main(void) {
10306
10319
  getShaders() {
10307
10320
  const shaders = super.getShaders();
10308
10321
  const data = this.props.data;
10309
- const BLOCK_WIDTH = data.blockWidth || Math.sqrt(data.length);
10322
+ const BLOCK_WIDTH = data.data.blockSize ?? Math.sqrt(data.length);
10310
10323
  return { ...shaders, defines: { ...shaders.defines, BLOCK_WIDTH }, vs: raster_layer_vertex_glsl_default };
10311
10324
  }
10312
10325
  initializeState() {
@@ -10348,13 +10361,9 @@ void main(void) {
10348
10361
  } = this.props;
10349
10362
  if (!data || !tileIndex)
10350
10363
  return null;
10351
- const { blockWidth, blockHeight } = data;
10352
- assert(
10353
- blockWidth === blockHeight,
10354
- `blockWidth (${blockWidth}) must equal blockHeight (${blockHeight})`
10355
- );
10364
+ const blockSize = data.blockSize ?? 0;
10356
10365
  const [xOffset, yOffset, scale] = quadbinToOffset(tileIndex);
10357
- const offset = [xOffset, yOffset, scale / blockWidth];
10366
+ const offset = [xOffset, yOffset, scale / blockSize];
10358
10367
  const CellLayer = this.getSubLayerClass("column", RasterColumnLayer);
10359
10368
  return new CellLayer(
10360
10369
  this.props,
@@ -10369,7 +10378,7 @@ void main(void) {
10369
10378
  {
10370
10379
  data: {
10371
10380
  data,
10372
- length: blockWidth * blockHeight
10381
+ length: blockSize * blockSize
10373
10382
  },
10374
10383
  offset
10375
10384
  }
@@ -10398,7 +10407,8 @@ void main(void) {
10398
10407
  return new RasterLayer(props, { tileIndex });
10399
10408
  };
10400
10409
  var defaultProps7 = {
10401
- data: TilejsonPropType
10410
+ data: TilejsonPropType,
10411
+ tileSize: DEFAULT_TILE_SIZE
10402
10412
  };
10403
10413
  var RasterTileLayer = class extends import_core9.CompositeLayer {
10404
10414
  getLoadOptions() {
@@ -10536,11 +10546,11 @@ void main(void) {
10536
10546
 
10537
10547
  // ../../node_modules/@loaders.gl/gis/dist/lib/binary-features/binary-to-geojson.js
10538
10548
  function binaryToGeojson(data, options) {
10539
- const globalFeatureId = options === null || options === void 0 ? void 0 : options.globalFeatureId;
10549
+ const globalFeatureId = options?.globalFeatureId;
10540
10550
  if (globalFeatureId !== void 0) {
10541
10551
  return getSingleFeature(data, globalFeatureId);
10542
10552
  }
10543
- return parseFeatures(data, options === null || options === void 0 ? void 0 : options.type);
10553
+ return parseFeatures(data, options?.type);
10544
10554
  }
10545
10555
  function getSingleFeature(data, globalFeatureId) {
10546
10556
  const dataArray = normalizeInput(data);
@@ -10578,7 +10588,7 @@ void main(void) {
10578
10588
  return polygonToGeoJson(data, startIndex, endIndex);
10579
10589
  default:
10580
10590
  const unexpectedInput = data;
10581
- throw new Error(`Unsupported geometry type: ${unexpectedInput === null || unexpectedInput === void 0 ? void 0 : unexpectedInput.type}`);
10591
+ throw new Error(`Unsupported geometry type: ${unexpectedInput?.type}`);
10582
10592
  }
10583
10593
  }
10584
10594
  function normalizeInput(data, type) {
@@ -10622,33 +10632,20 @@ void main(void) {
10622
10632
  const geometry = binaryToGeometry(data, startIndex, endIndex);
10623
10633
  const properties = parseProperties(data, startIndex, endIndex);
10624
10634
  const fields = parseFields(data, startIndex, endIndex);
10625
- return {
10626
- type: "Feature",
10627
- geometry,
10628
- properties,
10629
- ...fields
10630
- };
10635
+ return { type: "Feature", geometry, properties, ...fields };
10631
10636
  }
10632
- function parseFields(data) {
10633
- let startIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
10634
- let endIndex = arguments.length > 2 ? arguments[2] : void 0;
10637
+ function parseFields(data, startIndex = 0, endIndex) {
10635
10638
  return data.fields && data.fields[data.featureIds.value[startIndex]];
10636
10639
  }
10637
- function parseProperties(data) {
10638
- let startIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
10639
- let endIndex = arguments.length > 2 ? arguments[2] : void 0;
10640
+ function parseProperties(data, startIndex = 0, endIndex) {
10640
10641
  const properties = Object.assign({}, data.properties[data.featureIds.value[startIndex]]);
10641
10642
  for (const key in data.numericProps) {
10642
10643
  properties[key] = data.numericProps[key].value[startIndex];
10643
10644
  }
10644
10645
  return properties;
10645
10646
  }
10646
- function polygonToGeoJson(data) {
10647
- let startIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -Infinity;
10648
- let endIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Infinity;
10649
- const {
10650
- positions
10651
- } = data;
10647
+ function polygonToGeoJson(data, startIndex = -Infinity, endIndex = Infinity) {
10648
+ const { positions } = data;
10652
10649
  const polygonIndices = data.polygonIndices.value.filter((x) => x >= startIndex && x <= endIndex);
10653
10650
  const primitivePolygonIndices = data.primitivePolygonIndices.value.filter((x) => x >= startIndex && x <= endIndex);
10654
10651
  const multi = polygonIndices.length > 2;
@@ -10660,10 +10657,7 @@ void main(void) {
10660
10657
  const ringCoordinates = ringToGeoJson(positions, startRingIndex, endRingIndex);
10661
10658
  coordinates2.push(ringCoordinates);
10662
10659
  }
10663
- return {
10664
- type: "Polygon",
10665
- coordinates: coordinates2
10666
- };
10660
+ return { type: "Polygon", coordinates: coordinates2 };
10667
10661
  }
10668
10662
  const coordinates = [];
10669
10663
  for (let i = 0; i < polygonIndices.length - 1; i++) {
@@ -10672,52 +10666,31 @@ void main(void) {
10672
10666
  const polygonCoordinates = polygonToGeoJson(data, startPolygonIndex, endPolygonIndex).coordinates;
10673
10667
  coordinates.push(polygonCoordinates);
10674
10668
  }
10675
- return {
10676
- type: "MultiPolygon",
10677
- coordinates
10678
- };
10669
+ return { type: "MultiPolygon", coordinates };
10679
10670
  }
10680
- function lineStringToGeoJson(data) {
10681
- let startIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -Infinity;
10682
- let endIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Infinity;
10683
- const {
10684
- positions
10685
- } = data;
10671
+ function lineStringToGeoJson(data, startIndex = -Infinity, endIndex = Infinity) {
10672
+ const { positions } = data;
10686
10673
  const pathIndices = data.pathIndices.value.filter((x) => x >= startIndex && x <= endIndex);
10687
10674
  const multi = pathIndices.length > 2;
10688
10675
  if (!multi) {
10689
10676
  const coordinates2 = ringToGeoJson(positions, pathIndices[0], pathIndices[1]);
10690
- return {
10691
- type: "LineString",
10692
- coordinates: coordinates2
10693
- };
10677
+ return { type: "LineString", coordinates: coordinates2 };
10694
10678
  }
10695
10679
  const coordinates = [];
10696
10680
  for (let i = 0; i < pathIndices.length - 1; i++) {
10697
10681
  const ringCoordinates = ringToGeoJson(positions, pathIndices[i], pathIndices[i + 1]);
10698
10682
  coordinates.push(ringCoordinates);
10699
10683
  }
10700
- return {
10701
- type: "MultiLineString",
10702
- coordinates
10703
- };
10684
+ return { type: "MultiLineString", coordinates };
10704
10685
  }
10705
10686
  function pointToGeoJson(data, startIndex, endIndex) {
10706
- const {
10707
- positions
10708
- } = data;
10687
+ const { positions } = data;
10709
10688
  const coordinates = ringToGeoJson(positions, startIndex, endIndex);
10710
10689
  const multi = coordinates.length > 1;
10711
10690
  if (multi) {
10712
- return {
10713
- type: "MultiPoint",
10714
- coordinates
10715
- };
10691
+ return { type: "MultiPoint", coordinates };
10716
10692
  }
10717
- return {
10718
- type: "Point",
10719
- coordinates: coordinates[0]
10720
- };
10693
+ return { type: "Point", coordinates: coordinates[0] };
10721
10694
  }
10722
10695
  function ringToGeoJson(positions, startIndex, endIndex) {
10723
10696
  startIndex = startIndex || 0;
@@ -10738,7 +10711,8 @@ void main(void) {
10738
10711
  var defaultProps8 = {
10739
10712
  ...import_geo_layers6.MVTLayer.defaultProps,
10740
10713
  data: TilejsonPropType,
10741
- dataComparator: TilejsonPropType.equal
10714
+ dataComparator: TilejsonPropType.equal,
10715
+ tileSize: DEFAULT_TILE_SIZE
10742
10716
  };
10743
10717
  var VectorTileLayer = class extends import_geo_layers6.MVTLayer {
10744
10718
  constructor(...propObjects) {
@@ -12875,7 +12849,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12875
12849
  // src/api/common.ts
12876
12850
  var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
12877
12851
  var DEFAULT_CLIENT = "deck-gl-carto";
12878
- var V3_MINOR_VERSION = "3.3";
12852
+ var V3_MINOR_VERSION = "3.4";
12879
12853
  var MAX_GET_LENGTH = 8192;
12880
12854
  var DEFAULT_PARAMETERS = {
12881
12855
  v: V3_MINOR_VERSION
@@ -12936,16 +12910,17 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12936
12910
  headers: customHeaders,
12937
12911
  errorContext
12938
12912
  }) {
12939
- const key = JSON.stringify({ baseUrl: baseUrl2, parameters, customHeaders });
12913
+ const key = createCacheKey(baseUrl2, parameters || {}, customHeaders || {});
12940
12914
  if (REQUEST_CACHE.has(key)) {
12941
12915
  return REQUEST_CACHE.get(key);
12942
12916
  }
12943
12917
  let url = baseUrl2;
12944
12918
  if (parameters) {
12945
- const allParameters = { ...DEFAULT_PARAMETERS, ...parameters };
12946
- const encodedParameters = Object.entries(allParameters).map(([key2, value]) => {
12947
- return encodeParameter(key2, value);
12948
- });
12919
+ const encodedParameters = Object.entries({ ...DEFAULT_PARAMETERS, ...parameters }).map(
12920
+ ([key2, value]) => {
12921
+ return encodeParameter(key2, value);
12922
+ }
12923
+ );
12949
12924
  url += `?${encodedParameters.join("&")}`;
12950
12925
  }
12951
12926
  const headers = { ...DEFAULT_HEADERS, ...customHeaders };
@@ -12975,6 +12950,11 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
12975
12950
  throw new CartoAPIError(error, errorContext);
12976
12951
  }
12977
12952
  }
12953
+ function createCacheKey(baseUrl2, parameters, headers) {
12954
+ const parameterEntries = Object.entries(parameters).sort(([a], [b]) => a > b ? 1 : -1);
12955
+ const headerEntries = Object.entries(headers).sort(([a], [b]) => a > b ? 1 : -1);
12956
+ return JSON.stringify({ baseUrl: baseUrl2, parameters: parameterEntries, headers: headerEntries });
12957
+ }
12978
12958
 
12979
12959
  // src/sources/base-source.ts
12980
12960
  var SOURCE_DEFAULTS = {
@@ -13075,7 +13055,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13075
13055
  var h3QuerySource = async function(options) {
13076
13056
  const {
13077
13057
  aggregationExp,
13078
- aggregationResLevel = 4,
13058
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_H3,
13079
13059
  sqlQuery,
13080
13060
  spatialDataColumn = "h3",
13081
13061
  queryParameters
@@ -13099,8 +13079,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13099
13079
  var h3TableSource = async function(options) {
13100
13080
  const {
13101
13081
  aggregationExp,
13102
- aggregationResLevel = 4,
13103
- columns,
13082
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_H3,
13104
13083
  spatialDataColumn = "h3",
13105
13084
  tableName
13106
13085
  } = options;
@@ -13113,9 +13092,6 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13113
13092
  if (aggregationResLevel) {
13114
13093
  urlParameters.aggregationResLevel = String(aggregationResLevel);
13115
13094
  }
13116
- if (columns) {
13117
- urlParameters.columns = columns.join(",");
13118
- }
13119
13095
  return baseSource("table", options, urlParameters);
13120
13096
  };
13121
13097
 
@@ -13137,7 +13113,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13137
13113
  var quadbinQuerySource = async function(options) {
13138
13114
  const {
13139
13115
  aggregationExp,
13140
- aggregationResLevel = 6,
13116
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN,
13141
13117
  sqlQuery,
13142
13118
  spatialDataColumn = "quadbin",
13143
13119
  queryParameters
@@ -13161,8 +13137,7 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13161
13137
  var quadbinTableSource = async function(options) {
13162
13138
  const {
13163
13139
  aggregationExp,
13164
- aggregationResLevel = 6,
13165
- columns,
13140
+ aggregationResLevel = DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN,
13166
13141
  spatialDataColumn = "quadbin",
13167
13142
  tableName
13168
13143
  } = options;
@@ -13175,9 +13150,6 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13175
13150
  if (aggregationResLevel) {
13176
13151
  urlParameters.aggregationResLevel = String(aggregationResLevel);
13177
13152
  }
13178
- if (columns) {
13179
- urlParameters.columns = columns.join(",");
13180
- }
13181
13153
  return baseSource("table", options, urlParameters);
13182
13154
  };
13183
13155
 
@@ -13190,8 +13162,20 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13190
13162
 
13191
13163
  // src/sources/vector-query-source.ts
13192
13164
  var vectorQuerySource = async function(options) {
13193
- const { columns, filters, spatialDataColumn = "geom", sqlQuery, queryParameters } = options;
13194
- const urlParameters = { spatialDataColumn, spatialDataType: "geo", q: sqlQuery };
13165
+ const {
13166
+ columns,
13167
+ filters,
13168
+ spatialDataColumn = "geom",
13169
+ sqlQuery,
13170
+ tileResolution = DEFAULT_TILE_RESOLUTION,
13171
+ queryParameters
13172
+ } = options;
13173
+ const urlParameters = {
13174
+ spatialDataColumn,
13175
+ spatialDataType: "geo",
13176
+ tileResolution: tileResolution.toString(),
13177
+ q: sqlQuery
13178
+ };
13195
13179
  if (columns) {
13196
13180
  urlParameters.columns = columns.join(",");
13197
13181
  }
@@ -13206,8 +13190,19 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
13206
13190
 
13207
13191
  // src/sources/vector-table-source.ts
13208
13192
  var vectorTableSource = async function(options) {
13209
- const { columns, filters, spatialDataColumn = "geom", tableName } = options;
13210
- const urlParameters = { name: tableName, spatialDataColumn, spatialDataType: "geo" };
13193
+ const {
13194
+ columns,
13195
+ filters,
13196
+ spatialDataColumn = "geom",
13197
+ tableName,
13198
+ tileResolution = DEFAULT_TILE_RESOLUTION
13199
+ } = options;
13200
+ const urlParameters = {
13201
+ name: tableName,
13202
+ spatialDataColumn,
13203
+ spatialDataType: "geo",
13204
+ tileResolution: tileResolution.toString()
13205
+ };
13211
13206
  if (columns) {
13212
13207
  urlParameters.columns = columns.join(",");
13213
13208
  }
@@ -14530,19 +14525,24 @@ ${formatErrorKey(key)}: ${errorContext[key]}`;
14530
14525
  if (type === "table") {
14531
14526
  dataset.data = await vectorTableSource({ ...options, columns, tableName: source });
14532
14527
  } else if (type === "query") {
14533
- dataset.data = await vectorQuerySource({ ...options, sqlQuery: source, queryParameters });
14528
+ dataset.data = await vectorQuerySource({
14529
+ ...options,
14530
+ columns,
14531
+ sqlQuery: source,
14532
+ queryParameters
14533
+ });
14534
14534
  }
14535
14535
  } else if (spatialDataType === "h3") {
14536
14536
  const options = { ...globalOptions, aggregationExp, aggregationResLevel, spatialDataColumn };
14537
14537
  if (type === "table") {
14538
- dataset.data = await h3TableSource({ ...options, columns, tableName: source });
14538
+ dataset.data = await h3TableSource({ ...options, tableName: source });
14539
14539
  } else if (type === "query") {
14540
14540
  dataset.data = await h3QuerySource({ ...options, sqlQuery: source, queryParameters });
14541
14541
  }
14542
14542
  } else if (spatialDataType === "quadbin") {
14543
14543
  const options = { ...globalOptions, aggregationExp, aggregationResLevel, spatialDataColumn };
14544
14544
  if (type === "table") {
14545
- dataset.data = await quadbinTableSource({ ...options, columns, tableName: source });
14545
+ dataset.data = await quadbinTableSource({ ...options, tableName: source });
14546
14546
  } else if (type === "query") {
14547
14547
  dataset.data = await quadbinQuerySource({ ...options, sqlQuery: source, queryParameters });
14548
14548
  }