Unify getMapConfig signature for overviews adapter
This commit is contained in:
@@ -182,7 +182,8 @@ MapController.prototype.create = function(req, res, prepareConfigFn) {
|
||||
function addOverviewsInformation(err, requestMapConfig, datasource) {
|
||||
assert.ifError(err);
|
||||
var next = this;
|
||||
self.overviewsAdapter.getMapConfig(req.context.user, requestMapConfig, analysesResults,
|
||||
context.analysesResults = analysesResults;
|
||||
self.overviewsAdapter.getMapConfig(req.context.user, requestMapConfig, req.params, context,
|
||||
function(err, requestMapConfig) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
||||
@@ -9,10 +9,11 @@ function MapConfigOverviewsAdapter(overviewsMetadataApi, filterStatsApi) {
|
||||
|
||||
module.exports = MapConfigOverviewsAdapter;
|
||||
|
||||
MapConfigOverviewsAdapter.prototype.getMapConfig = function(user, requestMapConfig, analysesResults, callback) {
|
||||
MapConfigOverviewsAdapter.prototype.getMapConfig = function(user, requestMapConfig, params, context, callback) {
|
||||
var self = this;
|
||||
|
||||
var layers = requestMapConfig.layers;
|
||||
var analysesResults = context.analysesResults;
|
||||
|
||||
if (!layers || layers.length === 0) {
|
||||
return callback(null, requestMapConfig);
|
||||
|
||||
@@ -139,8 +139,8 @@ NamedMapMapConfigProvider.prototype.getMapConfig = function(callback) {
|
||||
function addOverviewsInformation(err, _mapConfig, datasource) {
|
||||
assert.ifError(err);
|
||||
var next = this;
|
||||
|
||||
self.overviewsAdapter.getMapConfig(self.owner, _mapConfig, self.analysesResults, function(err, _mapConfig) {
|
||||
context.analysesResults = self.analysesResults;
|
||||
self.overviewsAdapter.getMapConfig(self.owner, _mapConfig, rendererParams, context, function(err, _mapConfig) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,10 @@ describe('MapConfigOverviewsAdapter', function() {
|
||||
layers: [layer_without_overviews]
|
||||
};
|
||||
|
||||
mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, [], function(err, mapConfig) {
|
||||
var params = {};
|
||||
var context = {};
|
||||
|
||||
mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, params, context, function(err, mapConfig) {
|
||||
assert.ok(!err);
|
||||
var layers = mapConfig.layers;
|
||||
assert.equal(layers.length, 1);
|
||||
@@ -70,7 +73,10 @@ describe('MapConfigOverviewsAdapter', function() {
|
||||
layers: [layer_with_overviews]
|
||||
};
|
||||
|
||||
mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, [], function(err, mapConfig) {
|
||||
var params = {};
|
||||
var context = {};
|
||||
|
||||
mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, params, context, function(err, mapConfig) {
|
||||
assert.ok(!err);
|
||||
var layers = mapConfig.layers;
|
||||
assert.equal(layers.length, 1);
|
||||
|
||||
Reference in New Issue
Block a user