Unify getMapConfig signature
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user