tileserver-gl-light 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PUBLISHING.md +8 -1
- package/docs/deployment.rst +2 -2
- package/package.json +5 -5
- package/public/resources/maplibre-gl-inspect.css +2 -1
- package/public/templates/index.tmpl +1 -1
- package/publish.js +15 -9
- package/src/main.js +31 -30
- package/src/serve_data.js +22 -22
- package/src/serve_font.js +12 -12
- package/src/serve_light.js +10 -0
- package/src/serve_rendered.js +121 -120
- package/src/serve_style.js +15 -15
- package/src/server.js +122 -121
- package/src/utils.js +13 -15
- package/test/metadata.js +30 -30
- package/test/setup.js +9 -5
- package/test/static.js +4 -4
- package/test/style.js +18 -18
- package/test/tiles_data.js +4 -4
- package/test/tiles_rendered.js +5 -5
package/test/style.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const testIs = function(url, type, status) {
|
|
2
2
|
it(url + ' return ' + (status || 200) + ' and is ' + type.toString(),
|
|
3
3
|
function(done) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
supertest(app)
|
|
5
|
+
.get(url)
|
|
6
|
+
.expect(status || 200)
|
|
7
|
+
.expect('Content-Type', type, done);
|
|
8
|
+
});
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const prefix = 'test-style';
|
|
12
12
|
|
|
13
13
|
describe('Styles', function() {
|
|
14
14
|
describe('/styles/' + prefix + '/style.json is valid style', function() {
|
|
@@ -16,16 +16,16 @@ describe('Styles', function() {
|
|
|
16
16
|
|
|
17
17
|
it('contains expected properties', function(done) {
|
|
18
18
|
supertest(app)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
.get('/styles/' + prefix + '/style.json')
|
|
20
|
+
.expect(function(res) {
|
|
21
|
+
expect(res.body.version).to.be.equal(8);
|
|
22
|
+
expect(res.body.name).to.be.a('string');
|
|
23
|
+
expect(res.body.sources).to.be.a('object');
|
|
24
|
+
expect(res.body.glyphs).to.be.a('string');
|
|
25
|
+
expect(res.body.sprite).to.be.a('string');
|
|
26
|
+
expect(res.body.sprite).to.be.equal('/test/styles/test-style/sprite');
|
|
27
|
+
expect(res.body.layers).to.be.a('array');
|
|
28
|
+
}).end(done);
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
describe('/styles/streets/style.json is not served', function() {
|
|
@@ -44,7 +44,7 @@ describe('Fonts', function() {
|
|
|
44
44
|
testIs('/fonts/Open Sans Bold/0-255.pbf', /application\/x-protobuf/);
|
|
45
45
|
testIs('/fonts/Open Sans Regular/65280-65535.pbf', /application\/x-protobuf/);
|
|
46
46
|
testIs('/fonts/Open Sans Bold,Open Sans Regular/0-255.pbf',
|
|
47
|
-
|
|
47
|
+
/application\/x-protobuf/);
|
|
48
48
|
testIs('/fonts/Nonsense,Open Sans Bold/0-255.pbf', /./, 400);
|
|
49
49
|
|
|
50
50
|
testIs('/fonts/Nonsense/0-255.pbf', /./, 400);
|
package/test/tiles_data.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const testTile = function(prefix, z, x, y, status) {
|
|
2
|
+
const path = '/data/' + prefix + '/' + z + '/' + x + '/' + y + '.pbf';
|
|
3
3
|
it(path + ' returns ' + status, function(done) {
|
|
4
|
-
|
|
4
|
+
const test = supertest(app).get(path);
|
|
5
5
|
if (status) test.expect(status);
|
|
6
6
|
if (status == 200) test.expect('Content-Type', /application\/x-protobuf/);
|
|
7
7
|
test.end(done);
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const prefix = 'openmaptiles';
|
|
12
12
|
|
|
13
13
|
describe('Vector tiles', function() {
|
|
14
14
|
describe('existing tiles', function() {
|
package/test/tiles_rendered.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
const testTile = function(prefix, z, x, y, format, status, scale, type) {
|
|
2
2
|
if (scale) y += '@' + scale + 'x';
|
|
3
|
-
|
|
3
|
+
const path = '/styles/' + prefix + '/' + z + '/' + x + '/' + y + '.' + format;
|
|
4
4
|
it(path + ' returns ' + status, function(done) {
|
|
5
|
-
|
|
5
|
+
const test = supertest(app).get(path);
|
|
6
6
|
test.expect(status);
|
|
7
7
|
if (type) test.expect('Content-Type', type);
|
|
8
8
|
test.end(done);
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const prefix = 'test-style';
|
|
13
13
|
|
|
14
14
|
describe('Raster tiles', function() {
|
|
15
15
|
describe('valid requests', function() {
|
|
@@ -41,6 +41,6 @@ describe('Raster tiles', function() {
|
|
|
41
41
|
testTile(prefix, 0, 0, 0, 'png', 404, 1);
|
|
42
42
|
testTile(prefix, 0, 0, 0, 'png', 404, 5);
|
|
43
43
|
|
|
44
|
-
//testTile('hybrid', 0, 0, 0, 'png', 404); //TODO: test this
|
|
44
|
+
// testTile('hybrid', 0, 0, 0, 'png', 404); //TODO: test this
|
|
45
45
|
});
|
|
46
46
|
});
|