Unify getMapConfig signature

This commit is contained in:
Raul Ochoa
2016-05-23 16:50:26 +02:00
parent 9c1db98f67
commit 70750d2c43
3 changed files with 18 additions and 14 deletions

View File

@@ -196,13 +196,15 @@ MapController.prototype.create = function(req, res, prepareConfigFn) {
assert.ifError(err);
var next = this;
self.turboCartoAdapter.getMapConfig(req.context.user, requestMapConfig, function (err, requestMapConfig) {
if (err) {
return next(err);
}
self.turboCartoAdapter.getMapConfig(req.context.user, requestMapConfig, req.params, context,
function (err, requestMapConfig) {
if (err) {
return next(err);
}
return next(null, requestMapConfig, datasource);
});
return next(null, requestMapConfig, datasource);
}
);
},
function createLayergroup(err, requestMapConfig, datasource) {
assert.ifError(err);

View File

@@ -11,7 +11,7 @@ function TurboCartoAdapter(turboCartoParser) {
module.exports = TurboCartoAdapter;
TurboCartoAdapter.prototype.getMapConfig = function (username, requestMapConfig, callback) {
TurboCartoAdapter.prototype.getMapConfig = function (user, requestMapConfig, params, context, callback) {
var self = this;
var layers = requestMapConfig.layers;
@@ -23,7 +23,7 @@ TurboCartoAdapter.prototype.getMapConfig = function (username, requestMapConfig,
var parseCartoQueue = queue(layers.length);
layers.forEach(function(layer) {
parseCartoQueue.defer(self._parseCartoCss.bind(self), username, layer);
parseCartoQueue.defer(self._parseCartoCss.bind(self), user, layer);
});
parseCartoQueue.awaitAll(function (err, layers) {

View File

@@ -152,13 +152,15 @@ NamedMapMapConfigProvider.prototype.getMapConfig = function(callback) {
assert.ifError(err);
var next = this;
self.turboCartoAdapter.getMapConfig(self.owner, _mapConfig, function (err, _mapConfig) {
if (err) {
return next(err);
}
self.turboCartoAdapter.getMapConfig(self.owner, _mapConfig, rendererParams, context,
function (err, _mapConfig) {
if (err) {
return next(err);
}
return next(null, _mapConfig, datasource);
});
return next(null, _mapConfig, datasource);
}
);
},
function prepareContextLimits(err, _mapConfig, _datasource) {
assert.ifError(err);