@carto/api-client 0.5.1-alpha.0 → 0.5.1-alpha.2

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/build/worker.js CHANGED
@@ -126,6 +126,16 @@ var _InvalidColumnError = class _InvalidColumnError extends Error {
126
126
  };
127
127
  __publicField(_InvalidColumnError, "NAME", "InvalidColumnError");
128
128
  var InvalidColumnError = _InvalidColumnError;
129
+ function assignOptional(target, ...sources) {
130
+ for (const source2 of sources) {
131
+ for (const key in source2) {
132
+ if (source2[key] !== void 0) {
133
+ target[key] = source2[key];
134
+ }
135
+ }
136
+ }
137
+ return target;
138
+ }
129
139
 
130
140
  // src/utils/makeIntervalComplete.ts
131
141
  function makeIntervalComplete(intervals) {
@@ -4911,7 +4921,6 @@ function tileFeaturesGeometries({
4911
4921
  continue;
4912
4922
  }
4913
4923
  const transformedGeometryToIntersect = tileFormat === "mvt" /* MVT */ ? transformToTileCoords(clippedGeometryToIntersect.geometry, bbox2) : clippedGeometryToIntersect.geometry;
4914
- createIndicesForPoints(tile.data.points);
4915
4924
  calculateFeatures({
4916
4925
  map,
4917
4926
  tileIsFullyVisible,
@@ -4998,7 +5007,7 @@ function addIntersectedFeaturesInTile({
4998
5007
  uniqueIdProperty,
4999
5008
  options
5000
5009
  }) {
5001
- const indices = getIndices(data);
5010
+ const indices = getIndices(data, type);
5002
5011
  const storeGeometry = options?.storeGeometry || false;
5003
5012
  for (let i = 0; i < indices.length - 1; i++) {
5004
5013
  const startIndex = indices[i];
@@ -5017,20 +5026,22 @@ function addIntersectedFeaturesInTile({
5017
5026
  });
5018
5027
  }
5019
5028
  }
5020
- function getIndices(data) {
5029
+ function getIndices(data, type) {
5021
5030
  let indices;
5022
- switch (data.type) {
5023
- case "Point":
5024
- indices = data.pointIndices;
5031
+ switch (type) {
5032
+ case "Polygon":
5033
+ indices = data.primitivePolygonIndices;
5025
5034
  break;
5026
5035
  case "LineString":
5027
5036
  indices = data.pathIndices;
5028
5037
  break;
5029
- case "Polygon":
5030
- indices = data.primitivePolygonIndices;
5038
+ case "Point":
5039
+ indices = createIndicesForPoints(data);
5031
5040
  break;
5032
5041
  default:
5033
- throw new Error(`Unexpected type, "${data.type}"`);
5042
+ throw new Error(
5043
+ `Unsupported geometry type: ${type}`
5044
+ );
5034
5045
  }
5035
5046
  return indices.value;
5036
5047
  }
@@ -5137,7 +5148,7 @@ function addAllFeaturesInTile({
5137
5148
  uniqueIdProperty,
5138
5149
  options
5139
5150
  }) {
5140
- const indices = getIndices(data);
5151
+ const indices = getIndices(data, type);
5141
5152
  const storeGeometry = options?.storeGeometry || false;
5142
5153
  for (let i = 0; i < indices.length - 1; i++) {
5143
5154
  const startIndex = indices[i];
@@ -5165,7 +5176,7 @@ function createIndicesForPoints(data) {
5165
5176
  };
5166
5177
  pointIndices.value.set(featureIds);
5167
5178
  pointIndices.value.set([lastFeatureId + 1], featureIds.length);
5168
- data.pointIndices = pointIndices;
5179
+ return pointIndices;
5169
5180
  }
5170
5181
 
5171
5182
  // src/filters/tileFeaturesSpatialIndex.ts
@@ -6166,8 +6177,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
6166
6177
  return;
6167
6178
  }
6168
6179
  this._features = tileFeatures({
6169
- ...this.props,
6170
- ...this._tileFeatureExtractOptions,
6180
+ ...assignOptional({}, this.props, this._tileFeatureExtractOptions),
6171
6181
  tiles: this._tiles,
6172
6182
  spatialFilter
6173
6183
  });