Rooms.html
6.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>뭐라도해</title>
<!-- Bootstrap core CSS-->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<!-- Page level plugin CSS-->
<link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/sb-admin.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Do+Hyeon&subset=korean" rel="stylesheet">
</head>
<body id="page-top">
<nav class="navbar navbar-expand navbar-dark bg-dark static-top">
<a class="navbar-brand mr-1" href="index.html">뭐라도해</a>
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
<i class="fas fa-bars"></i>
</button>
</nav>
<div id="wrapper">
<!-- Sidebar -->
<ul class="sidebar navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">
<i class="fas fa-map-marker"></i>
<span>Map</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Foods.html">
<i class="fas fa-utensils" area-hidden ="true"></i>
<span>Foods</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Entertainment.html">
<i class="fas fa-gamepad"></i>
<span>Entertainment</span>
</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="Rooms.html">
<i class="fas fa-bed"></i>
<span>Rooms</span>
</a>
</li>
</ul>
<div id="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="#">Rooms</a>
</li>
</ol>
<!-- Icon Cards-->
<div class="row" id="cardBody">
</div>
<script>
var result_rooms = [];
</script>
<script>
var entName = '';
var entType = '';
var card = '';
var map;
var service;
var _length =0;
var check = 0;
function initMap() {
// Try HTML5 geolocation.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
map = new google.maps.Map(document.getElementById('map'), {
center: pos,
zoom: 17
});
map.setCenter(pos);
service = new google.maps.places.PlacesService(map);
searchPlace('lodging','room');
// if (check ==1)
// makecard(_length);
});
}
}
function searchPlace(str, placeType) {
switch (placeType) {
case 'food':
service.nearbySearch({
location: pos,
radius: 500,
type: [str]
}, callback_foods);
break;
case 'entertainment':
service.nearbySearch({
location: pos,
radius: 500,
type: [str]
}, callback_entertainment);
break;
case 'room':
service.nearbySearch({
location: pos,
radius: 500,
type: [str]
}, callback_rooms);
break;
default:
break;
}
}
function callback_rooms(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
//console.log(results[i]);
result_rooms.push(results[i]);
_length +=1;
console.log(_length);
if (i ==results.length-1)
makecard(_length);
//console.log(result_entertainment[i]);
check =1;
}
}
}
function makecard(_length)
{
console.log("make");
console.log(_length);
for(var i =0;i<_length;i++)
{
entName = result_rooms[i].name;
console.log(entName);
var tmp = '<div class="col-xl-6 col-sm-6 mb-3">' +
'<div class="card text-white bg-light o-hidden h-100">' +
'<div class="card-body"' + ' style="height:350px; background-image:url(' + "'lodging.jpg'" + '); background-size: 100% 100%; background-repeat: no-repeat;">' + // place photo
'<div class="mr-5" id="nameDiv">'+entName+'</div>'+ // place name
//'<div class="mr-5" id="typeDiv">'+entType+'</div>'+ // place type
'</div>' +
'</div>' +
'</div>';
//card+=tmp;
console.log(tmp);
card +=tmp;
document.getElementById("cardBody").innerHTML = card;
}
}
</script>
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDg4CkUEEt_96n1ork1nL5t4E_SpdKrgMI&libraries=places&callback=initMap"
async defer></script>
<p class="small text-center text-muted my-5">
<em>More chart examples coming soon...</em>
</p>
</div>
<!-- /.container-fluid -->
<!-- Sticky Footer -->
<footer class="sticky-footer">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Copyright © Your Website 2018</span>
</div>
</div>
</footer>
</div>
<!-- /.content-wrapper -->
</div>
<!-- /#wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
</body>
</html>