Skip to content

Commit

Permalink
feature: wfs filtering (origo-map#1680)
Browse files Browse the repository at this point in the history
Fixes origo-map#1679
Adds setFilter and clearFilter methods to the wfs source
Example:
origo.api().getLayer('my_layer').getSource().setFilter("namn in ('Museiparken')")
  • Loading branch information
jokd authored Feb 9, 2023
1 parent 469a3f6 commit a7c3f5b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/layer/wfssource.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,23 @@ class WfsSource extends VectorSource {
.catch(() => failure());
}

/**
* Set filter on layer
* @param {any} cql
*/
setFilter(cql) {
this._options.filter = cql;
this.refresh();
}

/**
* Clear filter on layer
*/
clearFilter() {
this._options.filter = '';
this.refresh();
}

/**
* Helper to reuse code. Consider it to be private to this class
* @param {any} extent
Expand Down

0 comments on commit a7c3f5b

Please sign in to comment.