@carto/api-client 0.5.1-alpha.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.
@@ -10558,7 +10558,6 @@ function tileFeaturesGeometries({
10558
10558
  continue;
10559
10559
  }
10560
10560
  const transformedGeometryToIntersect = tileFormat === "mvt" /* MVT */ ? transformToTileCoords(clippedGeometryToIntersect.geometry, bbox2) : clippedGeometryToIntersect.geometry;
10561
- createIndicesForPoints(tile.data.points);
10562
10561
  calculateFeatures({
10563
10562
  map,
10564
10563
  tileIsFullyVisible,
@@ -10645,7 +10644,7 @@ function addIntersectedFeaturesInTile({
10645
10644
  uniqueIdProperty,
10646
10645
  options
10647
10646
  }) {
10648
- const indices = getIndices(data);
10647
+ const indices = getIndices(data, type);
10649
10648
  const storeGeometry = options?.storeGeometry || false;
10650
10649
  for (let i = 0; i < indices.length - 1; i++) {
10651
10650
  const startIndex = indices[i];
@@ -10664,20 +10663,22 @@ function addIntersectedFeaturesInTile({
10664
10663
  });
10665
10664
  }
10666
10665
  }
10667
- function getIndices(data) {
10666
+ function getIndices(data, type) {
10668
10667
  let indices;
10669
- switch (data.type) {
10670
- case "Point":
10671
- indices = data.pointIndices;
10668
+ switch (type) {
10669
+ case "Polygon":
10670
+ indices = data.primitivePolygonIndices;
10672
10671
  break;
10673
10672
  case "LineString":
10674
10673
  indices = data.pathIndices;
10675
10674
  break;
10676
- case "Polygon":
10677
- indices = data.primitivePolygonIndices;
10675
+ case "Point":
10676
+ indices = createIndicesForPoints(data);
10678
10677
  break;
10679
10678
  default:
10680
- throw new Error(`Unexpected type, "${data.type}"`);
10679
+ throw new Error(
10680
+ `Unsupported geometry type: ${type}`
10681
+ );
10681
10682
  }
10682
10683
  return indices.value;
10683
10684
  }
@@ -10784,7 +10785,7 @@ function addAllFeaturesInTile({
10784
10785
  uniqueIdProperty,
10785
10786
  options
10786
10787
  }) {
10787
- const indices = getIndices(data);
10788
+ const indices = getIndices(data, type);
10788
10789
  const storeGeometry = options?.storeGeometry || false;
10789
10790
  for (let i = 0; i < indices.length - 1; i++) {
10790
10791
  const startIndex = indices[i];
@@ -10812,7 +10813,7 @@ function createIndicesForPoints(data) {
10812
10813
  };
10813
10814
  pointIndices.value.set(featureIds);
10814
10815
  pointIndices.value.set([lastFeatureId + 1], featureIds.length);
10815
- data.pointIndices = pointIndices;
10816
+ return pointIndices;
10816
10817
  }
10817
10818
 
10818
10819
  // src/filters/tileFeaturesSpatialIndex.ts