From 5d0c8f512f6b1537acc469ecbe245e84ac8f53a1 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 22 May 2024 15:18:19 +0200 Subject: [PATCH] Added queryParams for wfssource (#1991) --- src/layer/wfssource.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layer/wfssource.js b/src/layer/wfssource.js index c69ba0373..d5b9d3c2f 100644 --- a/src/layer/wfssource.js +++ b/src/layer/wfssource.js @@ -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 @@ -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