Skip to content

Commit

Permalink
[api] Fix getFeaturesFromIds
Browse files Browse the repository at this point in the history
For GMF layers with multiple child layers.
  • Loading branch information
arnaud-morvan committed May 28, 2020
1 parent 116200f commit 4bca5a9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions api/src/Querent.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ export function getFeaturesFromIds(layer, ids) {
return;
}

const featureIds = ids.map(id => `${layer}.${id}`);
const gmfLayer = /** @type import('gmf/themes.js').GmfLayerWMS */ (overlayDef.layer);
const childLayerNames = [];
let featureIds = [];
for (const childLayer of gmfLayer.childLayers) {
childLayerNames.push(childLayer.name);
featureIds = featureIds.concat(ids.map(id => `${childLayer.name}.${id}`));
}

const params = {
'FEATUREID': featureIds.join(','),
'MAXFEATURES': ids.length,
'MAXFEATURES': featureIds.length,
'REQUEST': 'GetFeature',
'SERVICE': 'WFS',
'TYPENAME': layer,
'TYPENAME': childLayerNames.join(','),
'VERSION': '1.0.0'
};
const url = olUriAppendParams(overlayDef.ogcServer.urlWfs, params);
Expand Down

0 comments on commit 4bca5a9

Please sign in to comment.