Use center and zoom from style json (#507)

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

* Round zoom as style spec allows fractional zooms while tilejson spec does not
This commit is contained in:
Nathan Gass 2023-03-28 14:46:50 +02:00 committed by GitHub
parent ea0bb2ed6b
commit 89c6eb7ddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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