Skip to content

Commit

Permalink
Merge pull request #4571 from camptocamp/merge_2.2_into_2.3
Browse files Browse the repository at this point in the history
Merge 2.2 into 2.3
  • Loading branch information
ger-benjamin committed Jan 31, 2019
2 parents b13a062 + 09ed3dd commit debe6a2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
5 changes: 3 additions & 2 deletions contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ const exports = function(config, $scope, $injector) {
}
});

// Reload theme and background layer when login status changes.
// Reload theme when login status changes.
const previousThemeName = this.gmfThemeManager.getThemeName();
this.gmfThemeManager.setThemeName('', true);
if (evt.type !== 'ready') {
this.updateCurrentTheme_(previousThemeName);
}
// Reload themes when login status changes.
// Reload themes and background layer when login status changes.
this.gmfThemes_.loadThemes(roleId);
this.setDefaultBackground_(null);
this.updateHasEditableLayers_();
};

Expand Down
18 changes: 18 additions & 0 deletions options/ngeox.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ ngeox.Download;
* The options to use when sending GetFeature/GetFeatureInfo requests using
* the querent or map query service.
* @typedef {{
* bboxAsGETParam: (boolean|undefined),
* coordinate: (ol.Coordinate|undefined),
* dataSources: (Array.<ngeox.datasource.DataSource>|undefined),
* extent: (ol.Extent|undefined),
Expand All @@ -225,6 +226,14 @@ ngeox.Download;
ngeox.IssueGetFeaturesOptions;


/**
* Pass the queried bbox as a parameter of the GET query on WFS requests.
* Default to false.
* @type {boolean|undefined}
*/
ngeox.IssueGetFeaturesOptions.prototype.bboxAsGETParam;


/**
* The coordinate to issue the requests with, which can end up with either
* WMS or WFS requests.
Expand Down Expand Up @@ -719,6 +728,7 @@ ngeox.QueryResultSource.prototype.totalFeatureCount;
/**
* The options for the query service.
* @typedef {{
* bboxAsGETParam: (boolean|undefined),
* limit: (number|undefined),
* queryCountFirst: (boolean|undefined),
* sourceIdsProperty: (string|undefined),
Expand All @@ -731,6 +741,14 @@ ngeox.QueryResultSource.prototype.totalFeatureCount;
ngeox.QueryOptions;


/**
* Pass the queried bbox as a parameter of the GET query on WFS requests.
* Default to false.
* @type {boolean|undefined}
*/
ngeox.QueryOptions.prototype.bboxAsGETParam;


/**
* The maximum number of records per request the query service should ask.
* Defaults to `50`. Note that sources sharing the same URL are combined
Expand Down
9 changes: 8 additions & 1 deletion src/query/MapQuerent.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ const exports = class {
this.tolerancePx_ = options.tolerance !== undefined ?
options.tolerance : 3;

/**
* @type {boolean}
* @private
*/
this.bboxAsGETParam_ = options.bboxAsGETParam || false;

/**
* A hash of data source names classified by ids.
* @type {Object.<number, string>}
Expand Down Expand Up @@ -115,7 +121,8 @@ const exports = class {
queryableDataSources: queryableDataSources,
limit: limit,
tolerancePx: this.tolerancePx_,
wfsCount: this.queryCountFirst_
wfsCount: this.queryCountFirst_,
bboxAsGETParam: this.bboxAsGETParam_
});
this.result_.pending = true;
this.ngeoQuerent_.issue(options).then(this.handleResult_.bind(this));
Expand Down
4 changes: 4 additions & 0 deletions src/query/Querent.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ const exports = class {
let url;
const params = {};

if (options.bboxAsGETParam && bbox) {
params['bbox'] = bbox.join(',');
}

// (3) Build query options
for (const dataSource of dataSources) {

Expand Down

0 comments on commit debe6a2

Please sign in to comment.