YujeLee

map table 생성

...@@ -160,10 +160,9 @@ header ...@@ -160,10 +160,9 @@ header
160 160
161 .welcome{ 161 .welcome{
162 position: absolute; 162 position: absolute;
163 - top:50%; 163 + top:20vh;
164 left: 50%; 164 left: 50%;
165 width: 700px; height: 160px; 165 width: 700px; height: 160px;
166 - margin-top: -80px;
167 margin-left: -350px; 166 margin-left: -350px;
168 text-align:center; 167 text-align:center;
169 font-family: sans-serif; 168 font-family: sans-serif;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 font-family: 'Poppins', sans-serif; 7 font-family: 'Poppins', sans-serif;
8 } 8 }
9 body{ 9 body{
10 - background-color: #212620; 10 + background-color: #fff;
11 } 11 }
12 .nav-bar 12 .nav-bar
13 { 13 {
...@@ -52,14 +52,12 @@ body{ ...@@ -52,14 +52,12 @@ body{
52 position: absolute; 52 position: absolute;
53 font-size: 30px; 53 font-size: 30px;
54 width: 100%; 54 width: 100%;
55 - top:20%; 55 + height: 50px;
56 - left: 50%;
57 - transform: translate(-50%,-50%);
58 margin-top: 40px; 56 margin-top: 40px;
59 57
60 text-align:center; 58 text-align:center;
61 font-family: sans-serif; 59 font-family: sans-serif;
62 - color:#fff; 60 + color:#000;
63 } 61 }
64 .map-box{ 62 .map-box{
65 width:100% 63 width:100%
......
...@@ -20,25 +20,42 @@ ...@@ -20,25 +20,42 @@
20 <li><a href="">Contact</a></li> 20 <li><a href="">Contact</a></li>
21 </ul> 21 </ul>
22 </div> 22 </div>
23 - <div class="welcome"> 23 +
24 - <h1>당신 주위에서 열릴 공연들입니다</h1>
25 - </div>
26 </header> 24 </header>
27 - <div class="map-box"> 25 + <div class="welcome">
28 - <div id="map" 26 + <h1>당신 주위에서 열릴 공연들입니다</h1>
29 - style=" 27 + </div>
30 - position: absolute; 28 + <div class="map-box">
31 - border-radius: 5%; 29 + <div id="map"
32 - width:500px; height:350px; 30 + style="
33 - top:50%; 31 + position: absolute;
34 - left: 30%; 32 + border-radius: 5%;
35 - "></div> 33 + width:500px; height:60vh;
36 - </div> 34 + top:40vh;
37 - <div class="empty-box"> 35 + left: 50%;
36 + margin-left:-250px;
37 + margin-top:-30x;
38 + "></div>
39 + <div style="position:absolute; top: 110vh; color: #000;">
40 + <h2 > 주변 공연 </h2>
41 + </div>
42 + </div>
43 + <table style="position: absolute; top: 120vh;">
44 + <tr>
45 + <th>id</th>
46 + <th>행사 이름</th>
47 + <th>시작 날짜</th>
48 + </tr>
49 + <tbody id="map-data">
50 +
51 + </tbody>
52 + </table>
53 +
54 +
38 55
39 - </div>
40 <script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=a3386042ab2e0550ea06d265855b452c"></script> 56 <script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=a3386042ab2e0550ea06d265855b452c"></script>
41 <script> 57 <script>
58 + var dataContainer=document.getElementById('map-data');
42 var mapContainer = document.getElementById('map'), // 지도를 표시할 div 59 var mapContainer = document.getElementById('map'), // 지도를 표시할 div
43 mapOption = { 60 mapOption = {
44 center: new kakao.maps.LatLng(33.450701, 126.570667), // 지도의 중심좌표 61 center: new kakao.maps.LatLng(33.450701, 126.570667), // 지도의 중심좌표
...@@ -76,8 +93,16 @@ if (navigator.geolocation) { ...@@ -76,8 +93,16 @@ if (navigator.geolocation) {
76 displayShowMarker(locP,message); 93 displayShowMarker(locP,message);
77 94
78 console.log("near_show:"+data[i]); 95 console.log("near_show:"+data[i]);
96 + var row = `<tr>
97 + <td> ${data[i][0]}</td>
98 + <td> ${data[i][1]}</td>
99 + <td> ${data[i][2]}</td>
100 +
101 + </tr>`
102 + dataContainer.innerHTML+=row;
79 } 103 }
80 - } 104 + }
105 +
81 106
82 // 마커와 인포윈도우를 표시합니다 107 // 마커와 인포윈도우를 표시합니다
83 108
......