@carto/api-client 0.5.29 → 0.5.30-alpha.143d135.117

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### 0.5.30
6
+
7
+ - feat(widgetSources): support `SpatialIndexFilter` (H3/Quadbin cell selection) on `spatialFilter` (#296)
8
+
5
9
  ### 0.5.29
6
10
 
7
11
  - feat(sources): Support featureBbox parameter (#289)
@@ -185,6 +185,7 @@ __export(src_exports, {
185
185
  h3TilesetSource: () => h3TilesetSource,
186
186
  hasFilter: () => hasFilter,
187
187
  histogram: () => histogram,
188
+ isSpatialIndexFilter: () => isSpatialIndexFilter,
188
189
  makeIntervalComplete: () => makeIntervalComplete,
189
190
  negateAccessor: () => negateAccessor,
190
191
  opacityToAlpha: () => opacityToAlpha,
@@ -5801,6 +5802,9 @@ var SchemaFieldType = /* @__PURE__ */ ((SchemaFieldType2) => {
5801
5802
  SchemaFieldType2["Unknown"] = "unknown";
5802
5803
  return SchemaFieldType2;
5803
5804
  })(SchemaFieldType || {});
5805
+ function isSpatialIndexFilter(spatialFilter) {
5806
+ return Array.isArray(spatialFilter.indexes);
5807
+ }
5804
5808
 
5805
5809
  // src/utils.ts
5806
5810
  var FILTER_TYPES = new Set(Object.values(FilterType));
@@ -7666,16 +7670,17 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
7666
7670
  this._features.length = 0;
7667
7671
  }
7668
7672
  _extractTileFeatures(spatialFilter) {
7673
+ const geometryFilter = spatialFilter && !isSpatialIndexFilter(spatialFilter) ? spatialFilter : void 0;
7669
7674
  const prevInputs = this._tileFeatureExtractPreviousInputs;
7670
- if (this._features.length && spatialFilterEquals(prevInputs.spatialFilter, spatialFilter)) {
7675
+ if (this._features.length && spatialFilterEquals(prevInputs.spatialFilter, geometryFilter)) {
7671
7676
  return;
7672
7677
  }
7673
7678
  this._features = tileFeatures({
7674
7679
  ...assignOptional({}, this.props, this._tileFeatureExtractOptions),
7675
7680
  tiles: this._tiles,
7676
- spatialFilter
7681
+ spatialFilter: geometryFilter
7677
7682
  });
7678
- prevInputs.spatialFilter = spatialFilter;
7683
+ prevInputs.spatialFilter = geometryFilter;
7679
7684
  }
7680
7685
  /**
7681
7686
  * Loads features as GeoJSON (used for testing).
@@ -11835,6 +11840,7 @@ function hashBuckets(initialCount) {
11835
11840
  h3TilesetSource,
11836
11841
  hasFilter,
11837
11842
  histogram,
11843
+ isSpatialIndexFilter,
11838
11844
  makeIntervalComplete,
11839
11845
  negateAccessor,
11840
11846
  opacityToAlpha,