Use req2params middleware for attributes endpoint

This commit is contained in:
Daniel García Aubert
2017-09-21 22:47:08 +02:00
parent a9b0acc317
commit fac1ab4a1c

View File

@@ -67,9 +67,12 @@ LayergroupController.prototype.register = function(app) {
'/:token/:layer/:z/:x/:y.(:format)', cors(), userMiddleware,
this.layer.bind(this));
app.get(app.base_url_mapconfig +
'/:token/:layer/attributes/:fid', cors(), userMiddleware,
this.attributes.bind(this));
app.get(app.base_url_mapconfig + '/:token/:layer/attributes/:fid',
cors(),
userMiddleware,
this.req2paramsMiddleware,
this.attributes.bind(this)
);
app.get(app.base_url_mapconfig + '/static/center/:token/:z/:lat/:lng/:width/:height.:format',
cors(),
@@ -223,12 +226,7 @@ LayergroupController.prototype.attributes = function(req, res, next) {
req.profiler.start('windshaft.maplayer_attribute');
step(
function setupParams() {
self.req2params(req, res, this);
},
function retrieveFeatureAttributes(err) {
assert.ifError(err);
function retrieveFeatureAttributes() {
var mapConfigProvider = new MapStoreMapConfigProvider(
self.mapStore, req.context.user, self.userLimitsApi, req.params
);