fix: center without mercator_512
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
cc664af068
commit
b32abce1f6
1 changed files with 4 additions and 16 deletions
|
|
@ -49,7 +49,6 @@ const PATH_PATTERN =
|
||||||
const httpTester = /^(http(s)?:)?\/\//;
|
const httpTester = /^(http(s)?:)?\/\//;
|
||||||
|
|
||||||
const mercator = new SphericalMercator();
|
const mercator = new SphericalMercator();
|
||||||
const mercator_512 = new SphericalMercator({ size: 512 });
|
|
||||||
const getScale = (scale) => (scale || '@1x').slice(1, 2) | 0;
|
const getScale = (scale) => (scale || '@1x').slice(1, 2) | 0;
|
||||||
|
|
||||||
mlgl.on('message', (e) => {
|
mlgl.on('message', (e) => {
|
||||||
|
|
@ -576,24 +575,13 @@ export const serve_rendered = {
|
||||||
return res.status(404).send('Out of bounds');
|
return res.status(404).send('Out of bounds');
|
||||||
}
|
}
|
||||||
|
|
||||||
let tileCenter;
|
let tileCenter = mercator.ll(
|
||||||
if (tileSize === 512) {
|
|
||||||
tileCenter = mercator_512.ll(
|
|
||||||
[
|
[
|
||||||
((x + 0.5) / (1 << z)) * (tileSize << z),
|
((x + 0.5) / (1 << z)) * (256 << z),
|
||||||
((y + 0.5) / (1 << z)) * (tileSize << z),
|
((y + 0.5) / (1 << z)) * (256 << z),
|
||||||
],
|
],
|
||||||
z,
|
z,
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
tileCenter = mercator.ll(
|
|
||||||
[
|
|
||||||
((x + 0.5) / (1 << z)) * (tileSize << z),
|
|
||||||
((y + 0.5) / (1 << z)) * (tileSize << z),
|
|
||||||
],
|
|
||||||
z,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
return respondImage(
|
return respondImage(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue