From 5a44d6c5470eee86aa23368a663a9b19d4a495d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 10 May 2017 18:35:30 +0200 Subject: [PATCH] Drop geojson support for buffersize customization --- .../adapter/mapconfig-buffer-size-adapter.js | 2 +- test/acceptance/buffer-size-format.js | 98 ------------------- 2 files changed, 1 insertion(+), 99 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 e362375b..02ce6443 100644 --- a/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/mapconfig-buffer-size-adapter.js @@ -3,7 +3,7 @@ function MapConfigBufferSizeAdapter() { module.exports = MapConfigBufferSizeAdapter; -var formats = ['png', 'png32', 'mvt', 'grid.json', 'geojson']; +var formats = ['png', 'png32', 'mvt', 'grid.json']; MapConfigBufferSizeAdapter.prototype.getMapConfig = function (user, requestMapConfig, params, context, callback) { if (!context.templateParams || !context.templateParams.buffersize) { diff --git a/test/acceptance/buffer-size-format.js b/test/acceptance/buffer-size-format.js index f573057c..e62ee4a3 100644 --- a/test/acceptance/buffer-size-format.js +++ b/test/acceptance/buffer-size-format.js @@ -100,30 +100,6 @@ describe('buffer size per format', function () { callback(); } }, - { - desc: 'should get geojson tile using buffer-size 0 overriden by template params', - coords: { z: 7, x: 64, y: 48 }, - format: 'geojson', - fixturePath: './test/fixtures/buffer-size/tile-mvt-7.64.48-buffer-size-0.geojson', - mapConfig: createMapConfig({ geojson: 0 }), - assert: function (tile, callback) { - var dataFixture = JSON.parse(fs.readFileSync(this.fixturePath)); - assert.equal(tile.features.length, dataFixture.features.length); - callback(); - } - }, - { - desc: 'should get geojson tile using buffer-size 128 overriden by template params', - coords: { z: 7, x: 64, y: 48 }, - format: 'geojson', - fixturePath: './test/fixtures/buffer-size/tile-7.64.48-buffer-size-128.geojson', - mapConfig: createMapConfig({ geojson: 128 }), - assert: function (tile, callback) { - var dataFixture = JSON.parse(fs.readFileSync(this.fixturePath)); - assert.equal(tile.features.length, dataFixture.features.length); - callback(); - } - }, { desc: 'should get grid.json tile using buffer-size 0 overriden by template params', coords: { z: 7, x: 64, y: 48 }, @@ -238,46 +214,6 @@ describe('buffer size per format for named maps', function () { assert.imageIsSimilarToFile(tile, this.fixturePath, IMAGE_TOLERANCE_PER_MIL, callback); } }, - { - desc: 'should get geojson tile using buffer-size 0 overriden by template params', - coords: { z: 7, x: 64, y: 48 }, - format: 'geojson', - placeholders: { buffersize_geojson: 0 }, - fixturePath: './test/fixtures/buffer-size/tile-mvt-7.64.48-buffer-size-0.geojson', - template: createBufferSizeTemplate('named-default-buffer-size-by-format-geojson', { - geojson: '<%= buffersize_geojson %>' - }, { - "buffersize_geojson": { - "type": "number", - "default": "0" - } - }), - assert: function (tile, callback) { - var dataFixture = JSON.parse(fs.readFileSync(this.fixturePath)); - assert.equal(tile.features.length, dataFixture.features.length); - callback(); - } - }, - { - desc: 'should get geojson tile using buffer-size 128 overriden by template params', - coords: { z: 7, x: 64, y: 48 }, - format: 'geojson', - placeholders: { buffersize_geojson: 128 }, - fixturePath: './test/fixtures/buffer-size/tile-7.64.48-buffer-size-128.geojson', - template: createBufferSizeTemplate('named-custom-buffer-size-by-format-geojson', { - geojson: '<%= buffersize_geojson %>' - }, { - "buffersize_geojson": { - "type": "number", - "default": "0" - } - }), - assert: function (tile, callback) { - var dataFixture = JSON.parse(fs.readFileSync(this.fixturePath)); - assert.equal(tile.features.length, dataFixture.features.length); - callback(); - } - }, { desc: 'should get grid.json tile using buffer-size 0 overriden by template params', coords: { z: 7, x: 64, y: 48 }, @@ -420,40 +356,6 @@ describe('buffer size per format for named maps w/o placeholders', function () { callback(); } }, - { - desc: 'should get geojson tile using buffer-size 0 overriden by template params', - coords: { z: 7, x: 64, y: 48 }, - format: 'geojson', - placeholders: { - buffersize: { - geojson: 0 - } - }, - fixturePath: './test/fixtures/buffer-size/tile-mvt-7.64.48-buffer-size-0.geojson', - template: createBufferSizeTemplate('named-no-buffer-size-geojson-0', {}, {}), - assert: function (tile, callback) { - var dataFixture = JSON.parse(fs.readFileSync(this.fixturePath)); - assert.equal(tile.features.length, dataFixture.features.length); - callback(); - } - }, - { - desc: 'should get geojson tile using buffer-size 128 overriden by template params', - coords: { z: 7, x: 64, y: 48 }, - format: 'geojson', - placeholders: { - buffersize: { - geojson: 128 - } - }, - fixturePath: './test/fixtures/buffer-size/tile-7.64.48-buffer-size-128.geojson', - template: createBufferSizeTemplate('named-no-buffer-size-geojson-128', {}, {}), - assert: function (tile, callback) { - var dataFixture = JSON.parse(fs.readFileSync(this.fixturePath)); - assert.equal(tile.features.length, dataFixture.features.length); - callback(); - } - }, { desc: 'should get grid.json tile using buffer-size 0 overriden by template params', coords: { z: 7, x: 64, y: 48 },