mirror of
https://github.com/maptiler/tileserver-gl.git
synced 2024-09-11 03:55:27 +03:00
* test: using 512px rendered tiles Based on https://github.com/maptiler/tileserver-gl/pull/495 Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: use static renderer at zoom 0 renderer is not able to change the size of tile to more than 512px in tile mode Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * Add support for 512 sized raster tiles (#1) * Enable setting tilesize for raster tiles * Serve correct endpoint for raster tiles * Add 256 & 512 sized raster layers to wmts getCapabilities document * Update wmts getCapabilities tileMatrixSets * Add rendered tiles format for getTileUrls method * Update endpoints documentation * Add and fix tiles_rendered tests * fix: formatting Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: corrent bad merge Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: if tile size is undefined don't add it needed for data endpoint right now Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: set tile size in raster endpoints to 512 Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: add semicolon Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: lint Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: test z1 512px file that actually exists Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: make tileSize optional Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: cleaner if statement Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * docs: update tileSize to show as optional Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: allow tile size in data url Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: remove unneeded tileSize Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: set data as 256 tileSize for consistency Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * docs: add note about optional data tileSize Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: lint Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * Revert "fix: remove unneeded tileSize" This reverts commit a4583161bf53653d65a4606c407ba9b5249d1061. * fix: allow tile size to be set at json endpoints Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: set default endpoint tilesizes Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: don't use tilesize one data endpoint It doesn't do anything Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: default style endpoint to undefined Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: zoom 0 workaround Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * Revert "fix: zoom 0 workaround" This reverts commit 0f3bbd765c9c151016cec66768675f990676c8b3. * fix: limit min zoom to 1 in viewer Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: put back orig string Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * docs: add optional tilesize to TileJSON Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: cleanup thumbnails Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: default undefined like other data endpoints Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: move data xyz_link Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: remove console.log Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: lint Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * chore: update version Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: update path Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: join error Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> * fix: revert path change Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> --------- Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net> Co-authored-by: Petteri Pesonen <teemu.p.pesonen@gmail.com>
76 lines
2.3 KiB
JavaScript
76 lines
2.3 KiB
JavaScript
var testTile = function (
|
|
prefix,
|
|
tileSize = 256,
|
|
z,
|
|
x,
|
|
y,
|
|
format,
|
|
status,
|
|
scale,
|
|
type,
|
|
) {
|
|
if (scale) y += '@' + scale + 'x';
|
|
var path =
|
|
'/styles/' +
|
|
prefix +
|
|
'/' +
|
|
tileSize +
|
|
'/' +
|
|
z +
|
|
'/' +
|
|
x +
|
|
'/' +
|
|
y +
|
|
'.' +
|
|
format;
|
|
it(path + ' returns ' + status, function (done) {
|
|
var test = supertest(app).get(path);
|
|
test.expect(status);
|
|
if (type) test.expect('Content-Type', type);
|
|
test.end(done);
|
|
});
|
|
};
|
|
|
|
const prefix = 'test-style';
|
|
|
|
describe('Raster tiles', function () {
|
|
describe('valid requests', function () {
|
|
describe('various formats', function () {
|
|
testTile(prefix, 256, 0, 0, 0, 'png', 200, undefined, /image\/png/);
|
|
testTile(prefix, 512, 0, 0, 0, 'png', 200, undefined, /image\/png/);
|
|
testTile(prefix, 256, 0, 0, 0, 'jpg', 200, undefined, /image\/jpeg/);
|
|
testTile(prefix, 512, 0, 0, 0, 'jpg', 200, undefined, /image\/jpeg/);
|
|
testTile(prefix, 256, 0, 0, 0, 'jpeg', 200, undefined, /image\/jpeg/);
|
|
testTile(prefix, 512, 0, 0, 0, 'jpeg', 200, undefined, /image\/jpeg/);
|
|
testTile(prefix, 256, 0, 0, 0, 'webp', 200, undefined, /image\/webp/);
|
|
testTile(prefix, 512, 0, 0, 0, 'webp', 200, undefined, /image\/webp/);
|
|
});
|
|
|
|
describe('different coordinates and scales', function () {
|
|
testTile(prefix, 256, 1, 0, 0, 'png', 200);
|
|
testTile(prefix, 512, 1, 0, 0, 'png', 200);
|
|
testTile(prefix, 256, 0, 0, 0, 'png', 200, 2);
|
|
testTile(prefix, 512, 0, 0, 0, 'png', 200, 2);
|
|
testTile(prefix, 256, 0, 0, 0, 'png', 200, 3);
|
|
testTile(prefix, 512, 0, 0, 0, 'png', 200, 3);
|
|
testTile(prefix, 256, 2, 1, 1, 'png', 200, 3);
|
|
testTile(prefix, 512, 2, 1, 1, 'png', 200, 3);
|
|
});
|
|
});
|
|
|
|
describe('invalid requests return 4xx', function () {
|
|
testTile('non_existent', 256, 0, 0, 0, 'png', 404);
|
|
testTile(prefix, 256, -1, 0, 0, 'png', 404);
|
|
testTile(prefix, 256, 25, 0, 0, 'png', 404);
|
|
testTile(prefix, 256, 0, 1, 0, 'png', 404);
|
|
testTile(prefix, 256, 0, 0, 1, 'png', 404);
|
|
testTile(prefix, 256, 0, 0, 0, 'gif', 400);
|
|
testTile(prefix, 256, 0, 0, 0, 'pbf', 400);
|
|
|
|
testTile(prefix, 256, 0, 0, 0, 'png', 404, 1);
|
|
testTile(prefix, 256, 0, 0, 0, 'png', 404, 5);
|
|
|
|
testTile(prefix, 300, 0, 0, 0, 'png', 404);
|
|
});
|
|
});
|