From f4cb2217edacb2c5327476c0ce314174b45f4c02 Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Tue, 27 Oct 2026 10:48:53 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8B=A8=ED=92=8D=20=EC=A7=80=EB=8F=84?= =?UTF-8?q?=20=E2=80=94=20=EC=96=B4=EB=A6=B0=EC=9D=B4=EB=8C=80=EA=B3=B5?= =?UTF-8?q?=EC=9B=90=20=EC=B6=94=EA=B0=80,=20=EC=A7=80=EB=8F=84=20?= =?UTF-8?q?=EA=B0=80=EC=9A=B4=EB=8D=B0=20=EB=A7=9E=EC=B6=A4,=20+/=E2=88=92?= =?UTF-8?q?=20=EC=97=B0=ED=83=80=20=EC=8B=9C=20=EB=B0=98=EB=8C=80=EB=A1=9C?= =?UTF-8?q?=20=ED=99=95=EB=8C=80=EB=90=98=EB=8D=98=20=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/seo/foliage_2026.json | 10 ++++++++++ frontend/src/b/FoliagePage.tsx | 12 ++++++++---- frontend/src/b/foliage.ts | 4 +++- frontend/src/b/foliageMap.tsx | 3 ++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/frontend/seo/foliage_2026.json b/frontend/seo/foliage_2026.json index 795fa35..ea1d571 100644 --- a/frontend/seo/foliage_2026.json +++ b/frontend/seo/foliage_2026.json @@ -527,6 +527,16 @@ "basis": "가장 가까운 산림청 예측 지점(수리산, 은행나무) 날짜", "coord_point": "서울숲" }, + { + "name": "어린이대공원", + "kind": "maple", + "region": "서울 광진", + "lat": 37.5493, + "lon": 127.07626, + "peak": "2026-11-02", + "basis": "가장 가까운 산림청 예측 지점(수리산, 단풍나무류) 날짜", + "coord_point": "서울어린이대공원" + }, { "name": "덕수궁 돌담길", "kind": "ginkgo", diff --git a/frontend/src/b/FoliagePage.tsx b/frontend/src/b/FoliagePage.tsx index e2eee97..3e9d35a 100644 --- a/frontend/src/b/FoliagePage.tsx +++ b/frontend/src/b/FoliagePage.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react' import { useNavigate, useSearchParams } from 'react-router' import { cx } from '../lib/utils' -import { ICON_R, LABEL, LABEL_INK, LEAF_SHADOW, MAP_IMG, MAP_SRC, PROVINCE, PROVINCES, labelBoxes, placeProvinces, rankNow, STAGE, headline, md, placeLabels, spread, useFoliage, useLabelSize, type Box, type Kind, type Pt, type Spot, type Stage } from './foliage' +import { ICON_R, LABEL, LABEL_INK, LAND_CX, LEAF_SHADOW, MAP_IMG, MAP_SRC, PROVINCE, PROVINCES, labelBoxes, placeProvinces, rankNow, STAGE, headline, md, placeLabels, spread, useFoliage, useLabelSize, type Box, type Kind, type Pt, type Spot, type Stage } from './foliage' import { useSheet } from './sheetContext' import { FoliageMapShare, FoliageSpotShare } from './shareCards' import { SendIcon } from './svg' @@ -52,7 +52,7 @@ function Marker({ p, sel }: { p: Pt; sel: boolean }) { ) } -/** 단풍 지도 페이지: 명소 65곳을 지도에서 확대해 보고 목록으로 고른다. 한 손가락은 확대 전엔 페이지 스크롤, 확대 뒤엔 지도 이동 */ +/** 단풍 지도 페이지: 명소 66곳을 지도에서 확대해 보고 목록으로 고른다. 한 손가락은 확대 전엔 페이지 스크롤, 확대 뒤엔 지도 이동 */ export function FoliagePage() { const navigate = useNavigate() const [params] = useSearchParams() @@ -85,8 +85,10 @@ export function FoliagePage() { const [x0, x1, y0, y1] = [Math.min(...xs), Math.max(...xs), Math.min(...ys), Math.max(...ys)] // 위쪽은 맨 북쪽 이름표가 잘리지 않게 FIT_TOP 만큼 띄우고, 아래는 제주까지만 const h = H - FIT_TOP - FIT_BOTTOM - const s = Math.min(W / ((x1 - x0 + 0.14) * W), h / ((y1 - y0) * W)) - return { s, tx: W / 2 - ((x0 + x1) / 2) * W * s, ty: FIT_TOP + h / 2 - ((y0 + y1) / 2) * W * s } + // 가로는 땅 가운데(LAND_CX)에 맞추되 동·서 끝 명소가 다 들어오게 + const half = Math.max(LAND_CX - x0, x1 - LAND_CX) + 0.07 + const s = Math.min(W / (2 * half * W), h / ((y1 - y0) * W)) + return { s, tx: W / 2 - LAND_CX * W * s, ty: FIT_TOP + h / 2 - ((y0 + y1) / 2) * W * s } }, [box, spots]) const clamp = useCallback( @@ -289,6 +291,8 @@ export function FoliagePage() { drag = null } const onDbl = (e: MouseEvent) => { + // +/− 를 빨리 두 번 누른 건 확대로 치지 않는다 + if ((e.target as HTMLElement).closest('button')) return const p = local(e) zoomAt(2, p.x, p.y, true) } diff --git a/frontend/src/b/foliage.ts b/frontend/src/b/foliage.ts index 20ed7ff..1e8d4fe 100644 --- a/frontend/src/b/foliage.ts +++ b/frontend/src/b/foliage.ts @@ -30,6 +30,8 @@ function stage(peak: string, today: string): Stage { } const toXY = (lat: number, lon: number) => ({ x: (MAP.ox + (lon - MAP.lon0) * MAP.k * MAP.s) / MAP.size, y: (MAP.oy + (MAP.lat1 - lat) * MAP.s) / MAP.size }) +// 처음 화면 가로 가운데: 명소 가운데(127.9°)로 잡으면 서해 섬까지 든 땅이 왼쪽으로 쏠려 보여 서쪽으로 당김 +export const LAND_CX = toXY(36, 127.65).x // 지도 위 시·도 이름 자리(위경도). 서울·경기는 겹치지 않게 경기를 북쪽으로 조금 올림 export const PROVINCES = ( @@ -50,7 +52,7 @@ export const PROVINCES = ( export const md = (iso: string) => `${Number(iso.slice(5, 7))}/${Number(iso.slice(8, 10))}` const province = (m: Spot) => m.region.split(' ')[0].split('·') -/** 오늘(한국 시각) 기준 명소 65곳과 단계. 단풍철이 아니면 inSeason 이 false */ +/** 오늘(한국 시각) 기준 명소 66곳과 단계. 단풍철이 아니면 inSeason 이 false */ export function useFoliage() { const [today] = useState(() => { const t = kst(new Date()) diff --git a/frontend/src/b/foliageMap.tsx b/frontend/src/b/foliageMap.tsx index ca30389..09b5c1f 100644 --- a/frontend/src/b/foliageMap.tsx +++ b/frontend/src/b/foliageMap.tsx @@ -67,7 +67,8 @@ export function FoliageCard({ post }: { post?: PostReaction | null }) {
-
+ {/* 지도 그림은 땅이 왼쪽에 치우쳐 있어 오른쪽(빈 바다)으로 밀어 가운데에 맞춘다 */} +
{provs.map((v) => (