Use center and zoom from style json as default center for tilejson of rendered maps

This commit is contained in:
Nathan Gass 2020-12-18 14:24:26 +01:00 committed by Andrew Calcutt
parent ea0bb2ed6b
commit fd4786d252

View file

@ -1374,6 +1374,9 @@ export const serve_rendered = {
type: 'baselayer', type: 'baselayer',
}; };
const attributionOverride = params.tilejson && params.tilejson.attribution; const attributionOverride = params.tilejson && params.tilejson.attribution;
if (styleJSON.center && styleJSON.zoom) {
tileJSON.center = styleJSON.center.concat(styleJSON.zoom);
}
Object.assign(tileJSON, params.tilejson || {}); Object.assign(tileJSON, params.tilejson || {});
tileJSON.tiles = params.domains || options.domains; tileJSON.tiles = params.domains || options.domains;
fixTileJSONCenter(tileJSON); fixTileJSONCenter(tileJSON);