-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use center and zoom from style json #507
Conversation
src/serve_rendered.js
Outdated
@@ -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(styleJSON.zoom); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tileJSON.center = styleJSON.center.concat(Math.round(styleJSON.zoom));
worked
src/serve_rendered.js
Outdated
@@ -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(styleJSON.zoom); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tileJSON.center = styleJSON.center.concat(Math.round(styleJSON.zoom));
worked
* 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
Use the center and zoom values from the style json as default for the center in the tilejson of the rendered map. This is especially useful for serveAllStyles where there is no other way to set this values explicitly.