-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WFS attributes aliases to dataSources
- Loading branch information
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
goog.provide('gmf.WFSAliases'); | ||
|
||
goog.require('gmf'); | ||
goog.require('ngeo.datasource.DataSourcesHelper'); | ||
|
||
|
||
gmf.WFSAliases = class { | ||
|
||
/** | ||
* Service that provides methods to get additional information and actions | ||
* when perfoming WFS requests. | ||
* | ||
* @struct | ||
* @param {ngeo.datasource.DataSourcesHelper} ngeoDataSourcesHelper Ngeo data | ||
* source helper service. | ||
* @ngdoc service | ||
* @ngname gmfWFSAliases | ||
* @ngInject | ||
*/ | ||
constructor(ngeoDataSourcesHelper) { | ||
|
||
// === Injected properties === | ||
|
||
/** | ||
* @type {ngeo.datasource.DataSourcesHelper} | ||
* @private | ||
*/ | ||
this.ngeoDataSourcesHelper_ = ngeoDataSourcesHelper; | ||
} | ||
|
||
|
||
/** | ||
* @param {ngeo.datasource.OGC} dataSource Data source. | ||
* @export | ||
*/ | ||
describe(dataSource) { | ||
// Only QGIS Server supports WFS aliases | ||
if (dataSource.ogcServerType === 'qgisserver' && !dataSource.attributes) { | ||
// Trigger an additional WFS DescribeFeatureType request to get | ||
// datasource attributes, including aliases. | ||
this.ngeoDataSourcesHelper_.getDataSourceAttributes(dataSource); | ||
} | ||
} | ||
}; | ||
|
||
|
||
gmf.module.service('gmfWFSAliases', gmf.WFSAliases); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters