From 808c729a0e831d10ff8b85cda09ba38f17615e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 17 May 2017 12:33:41 +0200 Subject: [PATCH] Now supported formats for buffer-size customization are bound to the adapter --- .../mapconfig/adapter/mapconfig-buffer-size-adapter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js b/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js index 02ce6443..5b961ac4 100644 --- a/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js @@ -1,16 +1,15 @@ function MapConfigBufferSizeAdapter() { + this.formats = ['png', 'png32', 'mvt', 'grid.json']; } module.exports = MapConfigBufferSizeAdapter; -var formats = ['png', 'png32', 'mvt', 'grid.json']; - MapConfigBufferSizeAdapter.prototype.getMapConfig = function (user, requestMapConfig, params, context, callback) { if (!context.templateParams || !context.templateParams.buffersize) { return callback(null, requestMapConfig); } - formats.forEach(function (format) { + this.formats.forEach(function (format) { if (Number.isFinite(context.templateParams.buffersize[format])) { requestMapConfig.buffersize[format] = context.templateParams.buffersize[format]; }