Unify getMapConfig interface
This commit is contained in:
parent
6ccdb6cefd
commit
12c44fda6f
@ -136,6 +136,10 @@ MapController.prototype.create = function(req, res, prepareConfigFn) {
|
||||
var mapConfig;
|
||||
var analysesResults = [];
|
||||
|
||||
var user = req.context.user;
|
||||
var params = req.params;
|
||||
var context = {};
|
||||
|
||||
step(
|
||||
function setupParams(){
|
||||
self.req2params(req, this);
|
||||
@ -143,7 +147,7 @@ MapController.prototype.create = function(req, res, prepareConfigFn) {
|
||||
prepareConfigFn,
|
||||
function prepareSqlWrap(err, requestMapConfig) {
|
||||
assert.ifError(err);
|
||||
self.sqlWrapMapConfigAdapter.getMapConfig(requestMapConfig, this);
|
||||
self.sqlWrapMapConfigAdapter.getMapConfig(user, requestMapConfig, params, context, this);
|
||||
},
|
||||
function prepareAnalysisLayers(err, requestMapConfig) {
|
||||
assert.ifError(err);
|
||||
|
@ -4,7 +4,7 @@ function SqlWrapMapConfigAdapter() {
|
||||
module.exports = SqlWrapMapConfigAdapter;
|
||||
|
||||
|
||||
SqlWrapMapConfigAdapter.prototype.getMapConfig = function(requestMapConfig, callback) {
|
||||
SqlWrapMapConfigAdapter.prototype.getMapConfig = function(user, requestMapConfig, params, context, callback) {
|
||||
if (requestMapConfig && Array.isArray(requestMapConfig.layers)) {
|
||||
requestMapConfig.layers = requestMapConfig.layers.map(function(layer) {
|
||||
if (layer.options) {
|
||||
|
@ -60,6 +60,10 @@ NamedMapMapConfigProvider.prototype.getMapConfig = function(callback) {
|
||||
var rendererParams;
|
||||
var apiKey;
|
||||
|
||||
var user = this.owner;
|
||||
var params = this.params;
|
||||
var context = {};
|
||||
|
||||
step(
|
||||
function getTemplate() {
|
||||
self.getTemplate(this);
|
||||
@ -99,7 +103,7 @@ NamedMapMapConfigProvider.prototype.getMapConfig = function(callback) {
|
||||
},
|
||||
function prepareSqlWrap(err, requestMapConfig) {
|
||||
assert.ifError(err);
|
||||
self.sqlWrapMapConfigAdapter.getMapConfig(requestMapConfig, this);
|
||||
self.sqlWrapMapConfigAdapter.getMapConfig(user, requestMapConfig, params, context, this);
|
||||
},
|
||||
function prepareAnalysisLayers(err, requestMapConfig) {
|
||||
assert.ifError(err);
|
||||
|
Loading…
Reference in New Issue
Block a user