From d4cafc16dbfb90f2e957533c52705d58d3552830 Mon Sep 17 00:00:00 2001 From: jokd Date: Thu, 7 Dec 2023 11:07:07 +0100 Subject: [PATCH] Allow 0 as ID --- src/getfeature.js | 2 +- src/layer/wfssource.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/getfeature.js b/src/getfeature.js index dac6da52a..489f85351 100644 --- a/src/getfeature.js +++ b/src/getfeature.js @@ -88,7 +88,7 @@ sourceType.WFS = function wfsSourceType(id, layer, serverUrl, extent) { wfsSource = layer.getSource(); } - if (id) { + if (id || id === 0) { return wfsSource.getFeatureFromSourceByIds(id); } // Have to pick up filter from layer as MultiSelect changes filter on layer instead of source diff --git a/src/layer/wfssource.js b/src/layer/wfssource.js index 165481d70..f4cacf327 100644 --- a/src/layer/wfssource.js +++ b/src/layer/wfssource.js @@ -139,7 +139,7 @@ class WfsSource extends VectorSource { `&version=1.1.0&request=GetFeature&typeName=${this._options.featureType}&outputFormat=application/json`, `&srsname=${this._options.dataProjection}`].join(''); url += queryFilter; - if (ids) { + if (ids || ids === 0) { url += `&FeatureId=${ids}`; } url = encodeURI(url);