From 951463c947ad26947aeb90cc05733a4719544c18 Mon Sep 17 00:00:00 2001 From: Jonas Date: Fri, 5 Apr 2024 07:17:05 +0200 Subject: [PATCH] Added queryParams for wfssource --- src/layer/wfssource.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layer/wfssource.js b/src/layer/wfssource.js index f4cacf327..6d68791c6 100644 --- a/src/layer/wfssource.js +++ b/src/layer/wfssource.js @@ -100,6 +100,7 @@ class WfsSource extends VectorSource { */ async _loaderHelper(extent, cql, ignoreOriginalFilter, ids) { const serverUrl = this._options.url; + const queryParams = this._options.queryParams || {}; // Set up the cql filter as a combination of the layer filter and the temporary cql parameter let cqlfilter = ''; @@ -142,6 +143,11 @@ class WfsSource extends VectorSource { if (ids || ids === 0) { url += `&FeatureId=${ids}`; } + + Object.keys(queryParams).forEach(key => { + url += `&${key}=${queryParams[key]}`; + }); + url = encodeURI(url); // Actually fetch some features