@carto/api-client 0.5.0 → 0.5.1-alpha.1

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
@@ -4911,7 +4911,6 @@ function tileFeaturesGeometries({
4911
4911
  continue;
4912
4912
  }
4913
4913
  const transformedGeometryToIntersect = tileFormat === "mvt" /* MVT */ ? transformToTileCoords(clippedGeometryToIntersect.geometry, bbox2) : clippedGeometryToIntersect.geometry;
4914
- createIndicesForPoints(tile.data.points);
4915
4914
  calculateFeatures({
4916
4915
  map,
4917
4916
  tileIsFullyVisible,
@@ -4998,7 +4997,7 @@ function addIntersectedFeaturesInTile({
4998
4997
  uniqueIdProperty,
4999
4998
  options
5000
4999
  }) {
5001
- const indices = getIndices(data);
5000
+ const indices = getIndices(data, type);
5002
5001
  const storeGeometry = options?.storeGeometry || false;
5003
5002
  for (let i = 0; i < indices.length - 1; i++) {
5004
5003
  const startIndex = indices[i];
@@ -5017,20 +5016,22 @@ function addIntersectedFeaturesInTile({
5017
5016
  });
5018
5017
  }
5019
5018
  }
5020
- function getIndices(data) {
5019
+ function getIndices(data, type) {
5021
5020
  let indices;
5022
- switch (data.type) {
5023
- case "Point":
5024
- indices = data.pointIndices;
5021
+ switch (type) {
5022
+ case "Polygon":
5023
+ indices = data.primitivePolygonIndices;
5025
5024
  break;
5026
5025
  case "LineString":
5027
5026
  indices = data.pathIndices;
5028
5027
  break;
5029
- case "Polygon":
5030
- indices = data.primitivePolygonIndices;
5028
+ case "Point":
5029
+ indices = createIndicesForPoints(data);
5031
5030
  break;
5032
5031
  default:
5033
- throw new Error(`Unexpected type, "${data.type}"`);
5032
+ throw new Error(
5033
+ `Unsupported geometry type: ${type}`
5034
+ );
5034
5035
  }
5035
5036
  return indices.value;
5036
5037
  }
@@ -5137,7 +5138,7 @@ function addAllFeaturesInTile({
5137
5138
  uniqueIdProperty,
5138
5139
  options
5139
5140
  }) {
5140
- const indices = getIndices(data);
5141
+ const indices = getIndices(data, type);
5141
5142
  const storeGeometry = options?.storeGeometry || false;
5142
5143
  for (let i = 0; i < indices.length - 1; i++) {
5143
5144
  const startIndex = indices[i];
@@ -5165,7 +5166,7 @@ function createIndicesForPoints(data) {
5165
5166
  };
5166
5167
  pointIndices.value.set(featureIds);
5167
5168
  pointIndices.value.set([lastFeatureId + 1], featureIds.length);
5168
- data.pointIndices = pointIndices;
5169
+ return pointIndices;
5169
5170
  }
5170
5171
 
5171
5172
  // src/filters/tileFeaturesSpatialIndex.ts
@@ -6409,7 +6410,7 @@ function assertColumn(features, ...columnArgs) {
6409
6410
  const columns = Array.from(new Set(columnArgs.map(normalizeColumns).flat()));
6410
6411
  const featureKeys = Object.keys(features[0]);
6411
6412
  const invalidColumns = columns.filter(
6412
- (column) => !featureKeys.includes(column)
6413
+ (column) => column && !featureKeys.includes(column)
6413
6414
  );
6414
6415
  if (invalidColumns.length) {
6415
6416
  throw new InvalidColumnError(