@@ -52,7 +52,6 @@ export default function KakaoMapLine({
5252} : KakaoMapLineProps ) {
5353 const router = useRouter ( ) ;
5454 const [ map , setMap ] = useState < kakao . maps . Map | null > ( null ) ;
55- const [ hoveredUserId , setHoveredUserId ] = useState < string | null > ( null ) ;
5655
5756 useEffect ( ( ) => {
5857 if ( ! map || ! endStation || userRoutes . length === 0 ) return ;
@@ -83,38 +82,28 @@ export default function KakaoMapLine({
8382 let meetingType = '' ;
8483 let category = '' ;
8584
86- // 🔥 1순위: localStorage에서 가져오기
8785 if ( typeof window !== 'undefined' ) {
8886 meetingType = localStorage . getItem ( `meeting_${ meetingId } _meetingType` ) || '' ;
8987 category = localStorage . getItem ( `meeting_${ meetingId } _category` ) || '' ;
9088 }
9189
92- // 🔥 2순위: localStorage에 없으면 purposes에서 가져오기 (fallback)
9390 if ( ! meetingType && purposes && purposes . length > 0 ) {
9491 meetingType = purposes [ 0 ] ;
9592 }
9693 if ( ! category && purposes && purposes . length > 1 ) {
9794 category = purposes [ purposes . length - 1 ] ;
9895 }
9996
100- console . log ( '🔍 meetingType:' , meetingType ) ;
101- console . log ( '🔍 category:' , category ) ;
102-
10397 const params = new URLSearchParams ( {
10498 meetingId,
10599 midPlace : endStation . name ,
106100 lat : endStation . latitude . toString ( ) ,
107101 lng : endStation . longitude . toString ( ) ,
108102 } ) ;
109103
110- if ( meetingType ) {
111- params . append ( 'meetingType' , meetingType ) ;
112- }
113- if ( category ) {
114- params . append ( 'category' , category ) ;
115- }
104+ if ( meetingType ) params . append ( 'meetingType' , meetingType ) ;
105+ if ( category ) params . append ( 'category' , category ) ;
116106
117- console . log ( '🔍 final URL:' , `/recommend?${ params . toString ( ) } ` ) ;
118107 router . push ( `/recommend?${ params . toString ( ) } ` ) ;
119108 } ;
120109
@@ -136,18 +125,18 @@ export default function KakaoMapLine({
136125 level = { 8 }
137126 onCreate = { setMap }
138127 >
128+ { /* 도착지 마커 */ }
139129 < CustomOverlayMap
140130 position = { { lat : endStation . latitude , lng : endStation . longitude } }
141- yAnchor = { 1.2 }
142- zIndex = { 20 }
131+ yAnchor = { 0.5 }
132+ zIndex = { 100 }
143133 >
144134 < div className = "flex items-center justify-center rounded-full border border-white bg-[#A95623] px-4 py-1.5 shadow-md" >
145135 < span className = "text-sm font-semibold text-white" > { endStation . name } </ span >
146136 </ div >
147137 </ CustomOverlayMap >
148138
149139 { userRoutes . map ( ( userRoute , index ) => {
150- const isHovered = hoveredUserId === userRoute . nickname ;
151140 const userColor = getRandomHexColor ( userRoute . nickname ) ;
152141
153142 const offsetMultiplier = index - ( userRoutes . length - 1 ) / 2 ;
@@ -181,36 +170,32 @@ export default function KakaoMapLine({
181170 />
182171 ) }
183172
184- < CustomOverlayMap position = { markerPosition } yAnchor = { 1 } zIndex = { isHovered ? 60 : 15 } >
185- < div
186- className = "group relative flex cursor-pointer flex-col items-center"
187- onMouseEnter = { ( ) => setHoveredUserId ( userRoute . nickname ) }
188- onMouseLeave = { ( ) => setHoveredUserId ( null ) }
189- >
190- < div
191- className = { `absolute bottom-full mb-2 flex flex-col items-center rounded bg-gray-900 px-3 py-1 shadow-lg transition-all duration-200 ${
192- isHovered
193- ? 'translate-y-0 opacity-100'
194- : 'pointer-events-none translate-y-2 opacity-0'
195- } `}
196- >
197- < span className = "text-xs whitespace-nowrap text-white" >
198- { userRoute . startStation } ({ userRoute . travelTime } 분)
173+ { /* 출발지 마커 & 정보창 (항상 표시) */ }
174+ < CustomOverlayMap
175+ position = { markerPosition }
176+ yAnchor = { 1 }
177+ zIndex = { 30 } // 마커가 선보다 위에 오도록
178+ >
179+ < div className = "flex flex-col items-center" >
180+ { /* 1. 상단 정보 말풍선 (검은색 박스) */ }
181+ < div className = "relative mb-2 flex min-w-[80px] flex-col items-center justify-center rounded bg-[#2C2F36] px-3 py-2 shadow-lg" >
182+ < span className = "text-[11px] leading-tight whitespace-nowrap text-white" >
183+ { userRoute . startStation } 역에서
184+ </ span >
185+ < span className = "text-blue-2 mt-0.5 text-[14px] leading-tight font-semibold whitespace-nowrap" >
186+ { userRoute . travelTime } 분
199187 </ span >
200- < div className = "absolute -bottom-1 h-2 w-2 rotate-45 bg-gray-900" > </ div >
188+
189+ { /* 말풍선 꼬리 (아래쪽 화살표) */ }
190+ < div className = "absolute -bottom-1.5 left-1/2 h-3 w-3 -translate-x-1/2 rotate-45 transform bg-[#2C2F36]" > </ div >
201191 </ div >
202192
193+ { /* 2. 하단 원형 프로필 아이콘 */ }
203194 < div
204- className = { `flex items-center justify-center rounded-full border-2 border-white shadow-sm transition-transform duration-200 ${
205- isHovered ? 'z-50 scale-125' : 'scale-100'
206- } `}
207- style = { {
208- backgroundColor : userColor ,
209- width : '32px' ,
210- height : '32px' ,
211- } }
195+ className = "z-10 flex h-10 w-10 items-center justify-center rounded-full border-2 border-white shadow-md"
196+ style = { { backgroundColor : userColor } }
212197 >
213- < span className = "text-xs font-bold text-white" >
198+ < span className = "text-lg font-bold text-white" >
214199 { userRoute . nickname . charAt ( 0 ) }
215200 </ span >
216201 </ div >
@@ -223,7 +208,7 @@ export default function KakaoMapLine({
223208
224209 < div className = "absolute top-4 left-1/2 z-10 -translate-x-1/2 transform" >
225210 < button
226- className = "bg-blue-5 hover:bg-blue-8 flex h-10 items-center rounded-full px-5 text-sm font-bold text-white shadow-lg transition-colors"
211+ className = "bg-blue-5 hover:bg-blue-8 flex h-10 items-center rounded-full px-5 text-sm font-bold whitespace-nowrap text-white shadow-lg transition-colors"
227212 onClick = { handleRecommendClick }
228213 >
229214 { endStation . name } 역 주변 장소 추천
0 commit comments