fix(map): 클러스터 expansion 후 마커 클릭 시 재묶임 방지

- selected 시 무조건 zoom 16 → 줌 18에서 마커 클릭하면 다시 16으로 줄어 클러스터링
- 현재 zoom ≥ 16이면 유지, 미만이면 16으로 (Naver/Google 둘 다)
- page.tsx의 setRegionFlyTo 호출 제거 — selected useEffect로 일원화

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
joungmin
2026-06-17 10:09:22 +09:00
parent 14384b0c71
commit 2eb16ce861
4 changed files with 15 additions and 8 deletions

View File

@@ -385,10 +385,8 @@ export default function Home() {
const handleSelectRestaurant = useCallback((r: Restaurant) => {
setSelected(r);
setShowDetail(true);
// 지도가 선택 식당으로 이동/줌인 — 객체 새로 만들어 flyTo effect 매번 트리거
if (r.latitude != null && r.longitude != null) {
setRegionFlyTo({ lat: r.latitude, lng: r.longitude, zoom: 16 });
}
// selected 변경 자체가 MapView 내부의 useEffect에서 중앙 이동을 처리.
// (flyTo를 같이 set하면 줌 16으로 강제되어 클러스터 expansion 후 마커 클릭 시 다시 묶임)
}, []);
const handleCloseDetail = useCallback(() => {