Mapconfig only support object for the buffer-size property

This commit is contained in:
Mario de Frutos 2017-04-28 14:22:16 +02:00
parent 2f4e4246a4
commit 332a56b736
2 changed files with 2 additions and 5 deletions

3
.gitignore vendored
View File

@ -8,6 +8,5 @@ tools/munin/windshaft.conf
logs/ logs/
pids/ pids/
redis.pid redis.pid
test.log *.log
npm-debug.log
coverage/ coverage/

View File

@ -479,9 +479,7 @@ TemplateMaps.prototype.instance = function(template, params) {
// NOTE: we're deep-cloning the layergroup here // NOTE: we're deep-cloning the layergroup here
var layergroup = JSON.parse(JSON.stringify(template.layergroup)); var layergroup = JSON.parse(JSON.stringify(template.layergroup));
if (typeof layergroup.buffersize === 'string') { if (layergroup.buffersize && isObject(layergroup.buffersize)) {
layergroup.buffersize = parseInt(_replaceVars(layergroup.buffersize, all_params), 10);
} else if (isObject(layergroup.buffersize)) {
Object.keys(layergroup.buffersize).forEach(function(k) { Object.keys(layergroup.buffersize).forEach(function(k) {
layergroup.buffersize[k] = parseInt(_replaceVars(layergroup.buffersize[k], all_params), 10); layergroup.buffersize[k] = parseInt(_replaceVars(layergroup.buffersize[k], all_params), 10);
}); });