Skip to content

Commit

Permalink
[Bugfix] SelectionTool: Use typeName instead of featureType
Browse files Browse the repository at this point in the history
The featureType is not necessarily the typeName for WFS getFeature request

Founded by Conseil Départemental du Calvados
  • Loading branch information
rldhont authored and github-actions[bot] committed Jan 19, 2024
1 parent c0ef7b1 commit eb5fc86
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/src/modules/SelectionTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ export default class SelectionTool {

for (const featureType of this.allFeatureTypeSelected) {
const lConfig = mainLizmap.config.layers[featureType];
let typeName = featureType;
if ('typename' in lConfig) {
typeName = lConfig.typename;
} else if ('shortname' in lConfig) {
typeName = lConfig.shortname;
}

// Yo avoid applying reverseAxis (not supported by QGIS GML Parser)
// Choose a srsName without reverseAxis
Expand All @@ -167,7 +173,7 @@ export default class SelectionTool {

let rFilter = lConfig?.request_params?.filter;
if( rFilter ){
rFilter = rFilter.replace( featureType + ':', '');
rFilter = rFilter.replace( typeName + ':', '');
spatialFilter = rFilter + ' AND ' + spatialFilter;
}

Expand All @@ -181,7 +187,7 @@ export default class SelectionTool {

const wfs = new WFS();
const wfsParams = {
TYPENAME: featureType,
TYPENAME: typeName,
EXP_FILTER: spatialFilter
};

Expand Down

0 comments on commit eb5fc86

Please sign in to comment.