From 6620f00ee1bbb9960dadfd8bce223488ed741f2e Mon Sep 17 00:00:00 2001 From: "jeonghyo.k" Date: Mon, 6 Apr 2026 22:29:21 +0900 Subject: [PATCH] =?UTF-8?q?feat(tiles):=20SR=20=EB=AF=BC=EA=B0=90=EC=9E=90?= =?UTF-8?q?=EC=9B=90=20=EB=B2=A1=ED=84=B0=ED=83=80=EC=9D=BC=20=ED=94=84?= =?UTF-8?q?=EB=A1=9D=EC=8B=9C=20=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Martin 서버의 SR 벡터타일, TileJSON, 스타일 JSON을 백엔드 프록시를 통해 제공하는 라우트 추가. Co-Authored-By: Claude Opus 4.6 --- backend/src/routes/tiles.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/backend/src/routes/tiles.ts b/backend/src/routes/tiles.ts index 0494823..a0ba100 100644 --- a/backend/src/routes/tiles.ts +++ b/backend/src/routes/tiles.ts @@ -54,6 +54,28 @@ router.get('/vworld/:z/:y/:x', async (req, res) => { await proxyUpstream(tileUrl, res, 'image/jpeg'); }); +// ─── SR 민감자원 벡터타일 ─── + +// GET /api/tiles/sr/tilejson — SR TileJSON 프록시 (source-layer 메타데이터) +router.get('/sr/tilejson', async (_req, res) => { + await proxyUpstream(`${ENC_UPSTREAM}/sr`, res, 'application/json'); +}); + +// GET /api/tiles/sr/style — SR 스타일 JSON 프록시 (레이어별 type/paint/layout 정의) +router.get('/sr/style', async (_req, res) => { + await proxyUpstream(`${ENC_UPSTREAM}/style/sr`, res, 'application/json'); +}); + +// GET /api/tiles/sr/:z/:x/:y — SR(민감자원) 벡터타일 프록시 +router.get('/sr/:z/:x/:y', async (req, res) => { + const { z, x, y } = req.params; + if (!/^\d+$/.test(z) || !/^\d+$/.test(x) || !/^\d+$/.test(y)) { + res.status(400).json({ error: '잘못된 타일 좌표' }); + return; + } + await proxyUpstream(`${ENC_UPSTREAM}/sr/${z}/${x}/${y}`, res, 'application/x-protobuf'); +}); + // ─── S-57 전자해도 (ENC) ─── // tiles.gcnautical.com CORS 제한 우회를 위한 프록시 엔드포인트 그룹