From 67d8fb83c1e51d62a47839c73b791b78e1a98620 Mon Sep 17 00:00:00 2001 From: Luca Ruschioni <44363237+Ruschio@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:57:37 +0100 Subject: [PATCH] Add FilterSpecification type --- src/source/geojson_source.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/source/geojson_source.js b/src/source/geojson_source.js index 6b5640e8461..cdd077ba2ca 100644 --- a/src/source/geojson_source.js +++ b/src/source/geojson_source.js @@ -15,7 +15,7 @@ import type Actor from '../util/actor.js'; import type {Callback} from '../types/callback.js'; import type {GeoJSONWorkerOptions} from './geojson_worker_source.js'; import type {GeoJSON, GeoJSONFeature} from '@mapbox/geojson-types'; -import type {GeoJSONSourceSpecification, PromoteIdSpecification} from '../style-spec/types.js'; +import type {GeoJSONSourceSpecification, PromoteIdSpecification, FilterSpecification} from '../style-spec/types.js'; import type {Cancelable} from '../types/cancelable.js'; /** @@ -192,7 +192,7 @@ class GeoJSONSource extends Evented implements Source { /** * Sets filter for the GeoJSON data source and re-renders the map. * - * @param {Array} filter An array for the filter expression. + * @param {FilterSpecification} filter A FilterSpecification type for the filter expression. * @returns {GeoJSONSource} Returns itself to allow for method chaining. * @example * map.addSource('source_id', { @@ -225,7 +225,7 @@ class GeoJSONSource extends Evented implements Source { * "Another Island" * ]); */ - setFilter(filter: Array): this { + setFilter(filter: ?FilterSpecification): this { this.workerOptions = extend({filter}, this.workerOptions); this._updateWorkerData(); return this;