Skip to content

Commit 192df49

Browse files
authored
Merge pull request #90 from 2025-All4Land-RideOn/test
test
2 parents 42433ad + 54dff29 commit 192df49

File tree

1 file changed

+91
-1
lines changed

1 file changed

+91
-1
lines changed

src/pages/MapView.jsx

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import { useGeoServerLayers } from "../hooks/useGeoServerLayers";
2828
import { useElevationPanel } from "../hooks/useElevationPanel";
2929
import WeatherLayer from "../components/WeatherLayer";
3030
import ElevationPanel from "../components/ElevationPanel";
31+
// 팝업 컴포넌트 추가
32+
import MarkerPopup from '../components/MarkerPopup';
3133

3234
const MapView = ({
3335
activeTab,
@@ -94,6 +96,9 @@ const MapView = ({
9496
clearSelectedRouteMarkerRef,
9597
previewRoute,
9698
highlightStep,
99+
// ✨ 추가된 부분: 팝업 관련 상태와 함수
100+
selectedFacility,
101+
closeFacilityPopup,
97102
} = useRouting(mapInstance);
98103

99104
// 고도 패널 훅
@@ -415,6 +420,91 @@ const MapView = ({
415420
</div>
416421
)}
417422

423+
{/* 경로 선 편의시설 추가 */}
424+
{selectedFacility && (
425+
<div
426+
style={{
427+
position: 'absolute',
428+
top: '20px',
429+
right: '20px',
430+
zIndex: 1000,
431+
backgroundColor: 'white',
432+
padding: '15px',
433+
borderRadius: '8px',
434+
boxShadow: '0 2px 10px rgba(0,0,0,0.2)',
435+
minWidth: '220px',
436+
fontFamily: "'Pretendard', sans-serif"
437+
}}
438+
>
439+
<button
440+
onClick={closeFacilityPopup}
441+
style={{
442+
float: 'right',
443+
border: 'none',
444+
background: 'none',
445+
cursor: 'pointer',
446+
fontSize: '18px',
447+
padding: '0 5px'
448+
}}
449+
>
450+
451+
</button>
452+
453+
{/* 시설 이름 */}
454+
<h3 style={{ marginTop: 0, marginBottom: '10px', fontSize: '16px', color: '#333' }}>
455+
{selectedFacility.name}
456+
</h3>
457+
458+
{/* 주소 */}
459+
<p style={{ margin: '8px 0', fontSize: '13px', color: '#666', lineHeight: '1.4' }}>
460+
<strong>주소:</strong><br/>
461+
{selectedFacility.address}
462+
</p>
463+
464+
<hr style={{ border: 'none', borderTop: '1px solid #eee', margin: '10px 0' }} />
465+
466+
{/* 시설 타입별 상세 정보 */}
467+
{selectedFacility.type === 'station' && (
468+
<>
469+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
470+
<span style={{color:'#4CAF50'}}>🚲</span> <strong>자전거 수:</strong> {selectedFacility.bikeCount ?? 0}
471+
</p>
472+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
473+
<strong>운영시간:</strong> {selectedFacility.operationStart ? `${selectedFacility.operationStart} ~ ${selectedFacility.operationEnd}` : '정보 없음'}
474+
</p>
475+
</>
476+
)}
477+
478+
{selectedFacility.type === 'toilet' && (
479+
<>
480+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
481+
<span style={{color:'#2196F3'}}>🚻</span> <strong>운영시간:</strong> {selectedFacility.openHours || '정보 없음'}
482+
</p>
483+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
484+
<strong>유형:</strong> {selectedFacility.openType || '정보 없음'}
485+
</p>
486+
</>
487+
)}
488+
489+
{selectedFacility.type === 'fountain' && (
490+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
491+
<span style={{color:'#03A9F4'}}>💧</span> <strong>운영시간:</strong> {selectedFacility.operationHours || '상시'}
492+
</p>
493+
)}
494+
495+
{selectedFacility.type === 'repair' && (
496+
<>
497+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
498+
<span style={{color:'#FF9800'}}>🔧</span> <strong>시설 유형:</strong> {selectedFacility.facilityType === 'AIR_PUMP' ? '공기주입기' : '수리센터'}
499+
</p>
500+
<p style={{ margin: '5px 0', fontSize: '13px' }}>
501+
<strong>운영시간:</strong> {selectedFacility.operationHours || '정보 없음'}
502+
</p>
503+
</>
504+
)}
505+
</div>
506+
)}
507+
418508
{/* 고도 패널 차트 - 경로가 있을 때만 표시 */}
419509
{isRoutingMode && routeInfo && (
420510
<ElevationPanel
@@ -430,4 +520,4 @@ const MapView = ({
430520
);
431521
};
432522

433-
export default MapView;
523+
export default MapView;

0 commit comments

Comments
 (0)