Skip to content

Commit

Permalink
Added queryParams for wfssource (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
jokd authored May 22, 2024
1 parent d4626e3 commit 5d0c8f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/layer/wfssource.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class WfsSource extends VectorSource {
*/
async _loaderHelper(extent, extraFilter, ignoreOriginalFilter, ids) {
const serverUrl = this._options.url;
const queryParams = this._options.queryParams || {};

// Create the complete URL
// FIXME: rewrite using URL class
Expand Down Expand Up @@ -222,6 +223,11 @@ class WfsSource extends VectorSource {
} else { // If there are no ids requested, append the query filter
url += this._createQueryFilter(extent, extraFilter, ignoreOriginalFilter);
}

Object.keys(queryParams).forEach(key => {
url += `&${key}=${queryParams[key]}`;
});

url = encodeURI(url);

// Actually fetch some features
Expand Down

0 comments on commit 5d0c8f5

Please sign in to comment.