set mapType in the controller instead of in the adapter
This commit is contained in:
parent
006e21379f
commit
b75150e91e
@ -158,7 +158,10 @@ function prepareAdapterMapConfig (mapConfigAdapter) {
|
||||
context,
|
||||
(err, requestMapConfig, stats = { overviewsUsed : false }) => {
|
||||
req.profiler.done('anonymous.getMapConfig');
|
||||
|
||||
stats.mapType = 'anonymous';
|
||||
req.profiler.add(stats);
|
||||
|
||||
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
@ -37,8 +37,7 @@ MapConfigOverviewsAdapter.prototype.getMapConfig = function (user, requestMapCon
|
||||
|
||||
requestMapConfig.layers = layers;
|
||||
|
||||
const stats = { overviewsAddedToMapconfig,
|
||||
mapType: 'anonymous' };
|
||||
const stats = { overviewsAddedToMapconfig };
|
||||
|
||||
return callback(null, requestMapConfig, stats);
|
||||
});
|
||||
|
@ -72,7 +72,12 @@ describe('overviews metadata', function() {
|
||||
data: JSON.stringify(layergroup)
|
||||
}, {}, function(res) {
|
||||
assert.equal(res.statusCode, 200, res.body);
|
||||
assert.ok(JSON.parse(res.headers['x-tiler-profiler']).overviewsAddedToMapconfig);
|
||||
|
||||
const headers = JSON.parse(res.headers['x-tiler-profiler']);
|
||||
|
||||
assert.ok(headers.overviewsAddedToMapconfig);
|
||||
assert.equal(headers.mapType, 'anonymous');
|
||||
|
||||
var parsedBody = JSON.parse(res.body);
|
||||
assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid);
|
||||
expected_token = parsedBody.layergroupid;
|
||||
|
Loading…
Reference in New Issue
Block a user