Drop geojson support for buffersize customization

This commit is contained in:
Daniel García Aubert 2017-05-10 18:35:30 +02:00
parent 53d1b2fbbf
commit 5a44d6c547
2 changed files with 1 additions and 99 deletions

View File

@ -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) {

View File

@ -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 },