Skip to content

Commit

Permalink
Allow 0 as ID
Browse files Browse the repository at this point in the history
  • Loading branch information
jokd committed Dec 7, 2023
1 parent dd20f84 commit d4cafc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/getfeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/layer/wfssource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d4cafc1

Please sign in to comment.