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 }) {