demo 20-4-2026

This commit is contained in:
taDuc
2026-04-19 23:43:31 +07:00
parent 34e709cea4
commit 7804ef842b
6 changed files with 105 additions and 17 deletions

View File

@@ -47,7 +47,7 @@ router.get("/:z/:x/:y", (req, res) => {
const y = Number(req.params.y);
if (!Number.isInteger(z) || !Number.isInteger(x) || !Number.isInteger(y)) {
return res.status(400).send("Invalid tile coordinates");
return res.status(400).json({ error: "Invalid tile coordinates" });
}
// convert XYZ → TMS
@@ -64,7 +64,7 @@ router.get("/:z/:x/:y", (req, res) => {
const tile = stmt.get(z, x, tmsY);
if (!tile) {
return res.status(404).send("Tile not found");
return res.status(404).json({ error: "Tile not found" });
}
res.setHeader("Content-Type", contentType);