Add option to disable static maps (close #129)

This commit is contained in:
Petr Sloup 2017-03-14 16:12:19 +01:00
parent 37386bfb29
commit 0673c8990a
2 changed files with 108 additions and 105 deletions

View file

@ -27,7 +27,8 @@ Example::
}, },
"maxSize": 2048, "maxSize": 2048,
"pbfAlias": "pbf", "pbfAlias": "pbf",
"serveAllFonts": false "serveAllFonts": false,
"serveStaticMaps": true
}, },
"styles": { "styles": {
"basic": { "basic": {

View file

@ -474,6 +474,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
return z; return z;
}; };
if (options.serveStaticMaps !== false) {
var staticPattern = var staticPattern =
'/static/:raw(raw)?/%s/:width(\\d+)x:height(\\d+)' + '/static/:raw(raw)?/%s/:width(\\d+)x:height(\\d+)' +
':scale(' + SCALE_PATTERN + ')?\.:format([\\w]+)'; ':scale(' + SCALE_PATTERN + ')?\.:format([\\w]+)';
@ -589,6 +590,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
return respondImage(z, x, y, bearing, pitch, w, h, scale, format, return respondImage(z, x, y, bearing, pitch, w, h, scale, format,
res, next, overlay); res, next, overlay);
}); });
}
app.get('/rendered.json', function(req, res, next) { app.get('/rendered.json', function(req, res, next) {
var info = clone(tileJSON); var info = clone(tileJSON);