Change bearing and pitch format in static url
This commit is contained in:
parent
391c21a966
commit
4af6fb686f
2 changed files with 4 additions and 4 deletions
|
@ -42,7 +42,7 @@ See https://github.com/klokantech/tileserver-gl-data/blob/master/config.json
|
|||
- Available formats: `png`, `jpg` (`jpeg`), `webp`
|
||||
- TileJSON at `/styles/{id}/rendered.json`
|
||||
- Static images are rendered at:
|
||||
- `/styles/{id}/static/{lon},{lat},{zoom}[,{bearing},{pitch}]/{width}x{height}[@2x].{format}` (center-based)
|
||||
- `/styles/{id}/static/{lon},{lat},{zoom}[@{bearing}[,{pitch}]]/{width}x{height}[@2x].{format}` (center-based)
|
||||
- `/styles/{id}/static/{minx},{miny},{maxx},{maxy}/{width}x{height}[@2x].{format}` (area-based)
|
||||
- `/styles/{id}/static/auto/{width}x{height}[@2x].{format}` (autofit path -- see below)
|
||||
- The static image endpoints additionally support following query parameters:
|
||||
|
|
|
@ -408,15 +408,15 @@ module.exports = function(options, repo, params, id) {
|
|||
':scale(' + SCALE_PATTERN + ')?\.:format([\\w]+)';
|
||||
|
||||
var centerPattern =
|
||||
util.format(':lon(%s),:lat(%s),:z(\\d+):bearing(,%s)?:pitch(,%s)?',
|
||||
util.format(':lon(%s),:lat(%s),:z(\\d+)(@:bearing(%s)(,:pitch(%s))?)?',
|
||||
FLOAT_PATTERN, FLOAT_PATTERN, FLOAT_PATTERN, FLOAT_PATTERN);
|
||||
|
||||
app.get(util.format(staticPattern, centerPattern), function(req, res, next) {
|
||||
var z = req.params.z | 0,
|
||||
x = +req.params.lon,
|
||||
y = +req.params.lat,
|
||||
bearing = +((req.params.bearing || ',0').substring(1)),
|
||||
pitch = +((req.params.pitch || ',0').substring(1)),
|
||||
bearing = +(req.params.bearing || '0'),
|
||||
pitch = +(req.params.pitch || '0'),
|
||||
w = req.params.width | 0,
|
||||
h = req.params.height | 0,
|
||||
scale = getScale(req.params.scale),
|
||||
|
|
Loading…
Reference in a new issue