Skip to content

Commit

Permalink
Use center and zoom from style json (#507)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
xabbu42 authored Mar 28, 2023
1 parent ea0bb2e commit 89c6eb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/serve_rendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 89c6eb7

Please sign in to comment.