Skip to content

Commit

Permalink
Do not assert that there's only one filtrable WFS layer name
Browse files Browse the repository at this point in the history
  • Loading branch information
adube committed Jan 17, 2020
1 parent f2cdb46 commit bcab8b4
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/datasource/OGC.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,21 +1095,21 @@ class OGC extends ngeoDatasourceDataSource {
}

/**
* Returns the filtrable WFS layer name. This methods asserts that
* the name exists and is filtrable. It also asserts that there
* should be only one layer (if it has many) that "gets data" for
* data data source.
* Returns the filtrable WFS layer name.
*
* Altough a data source may contain multiple WFS wfs layers, only
* the first one is returned. We don't need to return more than one,
* since in that case a group is used in the WMS GetMap query, and
* each queryable layers will end up being used in WFS GetData
* queries sent.
*
* @return {string} WFS layer name.
*/
getFiltrableWFSLayerName() {
if (!this.filtrable) {
throw new Error('Missing filtrable');
}
const layerNames = this.getWFSLayerNames(true);
console.assert(
layerNames.length === 1,
'Only one layer should be filtrable, i.e. should be able to get data.'
);
return layerNames[0];
}

Expand Down Expand Up @@ -1172,6 +1172,11 @@ class OGC extends ngeoDatasourceDataSource {
* layers, i.e. only the attributes that are in all the given layers
* are returned.
*
* Among the attributes, geometry columns are returned as
* well. Therefore, if there are no attributes with a geometry name
* returned, then the Filter tool have the possibilily to filter the
* data source using spatial filters.
*
* @param {Array<string>} layerNames List of layer names
* @return {?Object<string, import('gmf/themes.js').GmfOgcServerAttribute>}
*/
Expand Down

0 comments on commit bcab8b4

Please sign in to comment.