@@ -14,6 +14,7 @@ import slopeImg from "../../assets/images/slope.svg";
1414import chargerImg from "../../assets/images/charger.svg" ;
1515import toiletImg from "../../assets/images/toilet.svg" ;
1616import elevatorImg from "../../assets/images/elevator.svg" ;
17+ import ModalView from "../MainPage/ModalView" ;
1718import cafe from "../../assets/images/cafe.svg" ;
1819import business from "../../assets/images/business.svg" ;
1920import culture from "../../assets/images/culture.svg" ;
@@ -31,12 +32,12 @@ function MapPage() {
3132 if ( ! navigator . geolocation ) {
3233 console . log ( "Geolocation is not supported by your browser" ) ;
3334 } else {
34- console . log ( "Locating..." ) ;
35+ // console.log("Locating...");
3536 navigator . geolocation . watchPosition (
3637 ( position ) => {
3738 setLat ( position . coords . latitude ) ;
3839 setLng ( position . coords . longitude ) ;
39- //console.log("lat:", lat, "lng:", lng);
40+ // console.log("lat:", lat, "lng:", lng);
4041 } ,
4142 ( ) => {
4243 console . log ( "Unable to retrieve your location" ) ;
@@ -90,27 +91,59 @@ function MapPage() {
9091 }
9192
9293 const renderMap = ( ) => {
93- return < GoogleMap
94- mapContainerStyle = { mapStyle }
95- zoom = { 18 }
96- center = { { lat : + lat , lng : + lng } }
97- onClick = { ( ) => setActiveMarker ( null ) } >
98- < div className = 'btnCont' >
99- < div className = 'filterBtnCont' >
100- < div onClick = { ( ) => setCategory ( "icon1" ) } > < img width = { 20 } style = { { marginRight :"0.5rem" } } src = { toiletImg } > </ img > 장애인 화장실</ div >
101- < div onClick = { ( ) => setCategory ( "icon2" ) } > < img width = { 20 } style = { { marginRight :"0.5rem" } } src = { chargerImg } > </ img > 휠체어 충전기</ div >
102- < div onClick = { ( ) => setCategory ( "icon3" ) } > < img width = { 20 } style = { { marginRight :"0.5rem" } } src = { elevatorImg } > </ img > 엘리베이터</ div >
103- < div onClick = { ( ) => setCategory ( "icon4" ) } > < img width = { 20 } style = { { marginRight :"0.5rem" } } src = { slopeImg } > </ img > 슬로프</ div >
104- < div onClick = { ( ) => setCategory ( "" ) } > 모두 보기</ div >
94+ return (
95+ < GoogleMap
96+ mapContainerStyle = { mapStyle }
97+ zoom = { 18 }
98+ center = { { lat : + lat , lng : + lng } }
99+ onClick = { ( ) => setActiveMarker ( null ) }
100+ >
101+ < div className = "btnCont" >
102+ < div className = "filterBtnCont" >
103+ < div onClick = { ( ) => setCategory ( "icon1" ) } >
104+ < img
105+ width = { 20 }
106+ style = { { marginRight : "0.5rem" } }
107+ src = { toiletImg }
108+ > </ img >
109+ 장애인 화장실
110+ </ div >
111+ < div onClick = { ( ) => setCategory ( "icon2" ) } >
112+ < img
113+ width = { 20 }
114+ style = { { marginRight : "0.5rem" } }
115+ src = { chargerImg }
116+ > </ img >
117+ 휠체어 충전기
118+ </ div >
119+ < div onClick = { ( ) => setCategory ( "icon3" ) } >
120+ < img
121+ width = { 20 }
122+ style = { { marginRight : "0.5rem" } }
123+ src = { elevatorImg }
124+ > </ img >
125+ 엘리베이터
126+ </ div >
127+ < div onClick = { ( ) => setCategory ( "icon4" ) } >
128+ < img
129+ width = { 20 }
130+ style = { { marginRight : "0.5rem" } }
131+ src = { slopeImg }
132+ > </ img >
133+ 슬로프
134+ </ div >
135+ < div onClick = { ( ) => setCategory ( "" ) } > 모두 보기</ div >
136+ </ div >
137+ < Link to = "/list" style = { { textDecoration : "none" , color : "black" } } >
138+ < div className = "listViewBtn" > 리스트 보기</ div >
139+ </ Link >
105140 </ div >
106- < Link to = "/" style = { { textDecoration : "none" , color : "black" } } >
107- < div className = "listViewBtn" > 리스트 보기</ div >
108- </ Link >
109- </ div >
110- { renderMarker }
111- < Marker position = { { lat : + lat , lng :+ lng } } icon = { myself } />
112- </ GoogleMap >
113- }
141+ { renderMarker }
142+ < Marker position = { { lat : + lat , lng : + lng } } /> ;
143+ </ GoogleMap >
144+ ) ;
145+ } ;
146+
114147
115148 const renderMarker =
116149 places &&
@@ -136,7 +169,10 @@ function MapPage() {
136169 >
137170 { activeMarker === place . _id ? (
138171 < InfoWindow onCloseClick = { ( ) => setActiveMarker ( null ) } >
139- { PlaceInfo ( place ) }
172+ < >
173+ < ModalView info = { place } />
174+ < div className = "mapModalPc" > { PlaceInfo ( place ) } </ div >
175+ </ >
140176 </ InfoWindow >
141177 ) : null }
142178 </ Marker >
0 commit comments