Print bbox to console
This commit is contained in:
parent
f77ccd06af
commit
4a602ca8fc
1 changed files with 7 additions and 3 deletions
|
|
@ -387,7 +387,7 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
|
||||||
|
|
||||||
var respondImage = function(z, lon, lat, bearing, pitch,
|
var respondImage = function(z, lon, lat, bearing, pitch,
|
||||||
width, height, scale, format, res, next,
|
width, height, scale, format, res, next,
|
||||||
opt_overlay) {
|
opt_overlay, opt_bbox) {
|
||||||
if (Math.abs(lon) > 180 || Math.abs(lat) > 85.06 ||
|
if (Math.abs(lon) > 180 || Math.abs(lat) > 85.06 ||
|
||||||
lon != lon || lat != lat) {
|
lon != lon || lat != lat) {
|
||||||
return res.status(400).send('Invalid center');
|
return res.status(400).send('Invalid center');
|
||||||
|
|
@ -419,7 +419,7 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
|
||||||
params.width *= 2;
|
params.width *= 2;
|
||||||
params.height *= 2;
|
params.height *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tileMargin = Math.max(options.tileMargin || 0, 0);
|
var tileMargin = Math.max(options.tileMargin || 0, 0);
|
||||||
if (z > 2 && tileMargin > 0) {
|
if (z > 2 && tileMargin > 0) {
|
||||||
params.width += tileMargin * 2 * scale;
|
params.width += tileMargin * 2 * scale;
|
||||||
|
|
@ -440,7 +440,7 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
|
||||||
channels: 4
|
channels: 4
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (z > 2 && tileMargin > 0) {
|
if (z > 2 && tileMargin > 0) {
|
||||||
image.extract({ left: tileMargin * scale, top: tileMargin * scale, width: width * scale, height: height * scale });
|
image.extract({ left: tileMargin * scale, top: tileMargin * scale, width: width * scale, height: height * scale });
|
||||||
}
|
}
|
||||||
|
|
@ -482,6 +482,10 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
|
||||||
return res.status(404).send('Not found');
|
return res.status(404).send('Not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opt_bbox) {
|
||||||
|
console.log(opt_bbox)
|
||||||
|
}
|
||||||
|
|
||||||
res.set({
|
res.set({
|
||||||
'Last-Modified': lastModified,
|
'Last-Modified': lastModified,
|
||||||
'Content-Type': 'image/' + format
|
'Content-Type': 'image/' + format
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue