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:
@@ -163,11 +163,12 @@ function MapContent({ restaurants, selected, onSelectRestaurant, flyTo, activeCh
|
||||
if (flyTo.zoom) map.setZoom(flyTo.zoom);
|
||||
}, [map, flyTo]);
|
||||
|
||||
// Pan and zoom to selected restaurant
|
||||
// Pan and zoom to selected restaurant — 현재 줌이 16 이상이면 유지(클러스터 expansion 후 재묶임 방지)
|
||||
useEffect(() => {
|
||||
if (!map || !selected) return;
|
||||
map.panTo({ lat: selected.latitude, lng: selected.longitude });
|
||||
map.setZoom(16);
|
||||
const currentZoom = map.getZoom() ?? 13;
|
||||
if (currentZoom < 16) map.setZoom(16);
|
||||
setInfoTarget(selected);
|
||||
}, [map, selected]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user