Do not add basename to tilejson and remove sensitive properties (see #69)
This commit is contained in:
parent
945e568b2b
commit
2d29a21596
3 changed files with 6 additions and 9 deletions
|
@ -41,8 +41,8 @@ module.exports = function(options, repo, params, id, styles) {
|
|||
Object.assign(tileJSON, info);
|
||||
|
||||
tileJSON['tilejson'] = '2.0.0';
|
||||
tileJSON['basename'] = id;
|
||||
tileJSON['filesize'] = mbtilesFileStats['size'];
|
||||
delete tileJSON['filesize'];
|
||||
delete tileJSON['mtime'];
|
||||
delete tileJSON['scheme'];
|
||||
|
||||
Object.assign(tileJSON, params.tilejson || {});
|
||||
|
|
|
@ -175,7 +175,6 @@ module.exports = function(options, repo, params, id, dataResolver) {
|
|||
'tilejson': '2.0.0',
|
||||
'name': styleJSON.name,
|
||||
'attribution': '',
|
||||
'basename': id,
|
||||
'minzoom': 0,
|
||||
'maxzoom': 20,
|
||||
'bounds': [-180, -85.0511, 180, 85.0511],
|
||||
|
@ -223,7 +222,6 @@ module.exports = function(options, repo, params, id, dataResolver) {
|
|||
var type = source.type;
|
||||
Object.assign(source, info);
|
||||
source.type = type;
|
||||
source.basename = name;
|
||||
source.tiles = [
|
||||
// meta url which will be detected when requested
|
||||
'mbtiles://' + name + '/{z}/{x}/{y}.' + (info.format || 'pbf')
|
||||
|
|
|
@ -18,7 +18,7 @@ var testTileJSONArray = function(url) {
|
|||
});
|
||||
};
|
||||
|
||||
var testTileJSON = function(url, basename) {
|
||||
var testTileJSON = function(url) {
|
||||
describe(url + ' is TileJSON', function() {
|
||||
it('is json', function(done) {
|
||||
supertest(app)
|
||||
|
@ -27,11 +27,10 @@ var testTileJSON = function(url, basename) {
|
|||
.expect('Content-Type', /application\/json/, done);
|
||||
});
|
||||
|
||||
it('has valid basename and tiles', function(done) {
|
||||
it('has valid tiles', function(done) {
|
||||
supertest(app)
|
||||
.get(url)
|
||||
.expect(function(res) {
|
||||
res.body.basename.should.equal(basename);
|
||||
res.body.tiles.length.should.be.greaterThan(0);
|
||||
}).end(done);
|
||||
});
|
||||
|
@ -64,6 +63,6 @@ describe('Metadata', function() {
|
|||
});
|
||||
});
|
||||
|
||||
testTileJSON('/styles/test-style/rendered.json', 'test-style');
|
||||
testTileJSON('/data/openmaptiles.json', 'openmaptiles');
|
||||
testTileJSON('/styles/test-style/rendered.json');
|
||||
testTileJSON('/data/openmaptiles.json');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue