-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsendai-2024.html
412 lines (352 loc) · 16 KB
/
sendai-2024.html
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sendai 2024-01</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/paper/bootstrap.min.css">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCikPtaGJr5nKhCpgqnjuwkDz33o94PAgM&libraries=places">
</script>
<style>
.nav-pills { margin: 20px 0; }
.nav-pills > li > a { padding: 5px 10px; }
.btn { margin: 5px 0; }
.label { background-color: #444; display: inline-block; margin: 10px 10px 0 0; padding: 4px 0; width: 45px; }
.glyphicon-map-marker { color: #333; }
.glyphicon-arrow-right { color: #999; }
a:link, a:visited, a:visited:hover, a:hover, a:active { text-decoration: none; }
#map { width: 100%; height: 300px; }
@media screen and (max-width: 576px) {
.control-label { font-size: 12px; font-weight: bold; padding: 8px 0 0 15px; }
.form-control { margin-left: 10px; width: 95%; }
.radio { margin-left: 10px; }
}
</style>
</head>
<body>
<div class="container">
<h4>
<a href="https://www.google.com/maps/d/viewer?mid=1gbEYt9MfnUol-nroKZ49zGBEt_ke-Z4&hl=en&usp=sharing" target="_blank">Sendai 2024-01</a>
</h4>
<ul class="nav nav-pills">
<li class='active'>
<a href='#' data-group='0'>
POIs
</a>
</li>
<li class='active'>
<a href='#' data-group='1'>
Restaurants
</a>
</li>
</ul>
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-1 col-xs-1 control-label" for="from">From:</label>
<div class="col-sm-11 col-xs-11">
<select id="from" class="form-control">
<option value="" data-color="#d3a">Current Location</option>
<option value='38.137184,140.9286618'
data-group='0'
data-color='FF5252'
data-placeid='ChIJ7bSZJT8iil8RxJqVJ_Z_wFQ'>
Sendai-Airport Station
</option>
<option value='38.2600425,140.8834764'
data-group='0'
data-color='FF5252'
data-placeid='ChIJ3zGS2hcoil8RmU5rtjXj4qQ'>
Hotel Metropolitan Sendai East
</option>
<option value='38.0408293,140.5303604'
data-group='0'
data-color='000000'
data-placeid='ChIJndjr2RJEil8R2SPai0gx0Fk'>
Zaō Fox Village (宮城蔵王キツネ村)
</option>
<option value='38.0027452,140.6173369'
data-group='0'
data-color='000000'
data-placeid='ChIJ4bmECBtCil8RYWCNb5SOxgs'>
Shiroishi Castle (白石城跡)
</option>
<option value='38.1616009,140.3952205'
data-group='0'
data-color='000000'
data-placeid='ChIJ9dVANwtLil8RLCyvTtj8TAU'>
Zao Ropeway Zao Sanroku Station (蔵王ロープウェイ 蔵王山麓駅)
</option>
<option value='38.5706177,140.5305457'
data-group='0'
data-color='000000'
data-placeid='ChIJq6pT2NpdiV8RJBQqpNQEx6M'>
Ginzan Onsen Tourist Information Center (銀山温泉案内所)
</option>
<option value='38.309597,140.4347332'
data-group='0'
data-color='000000'
data-placeid='ChIJ9YZe3u7Oi18RwMuiposzJjY'>
Yamadera Station (山寺駅)
</option>
<option value='38.259364,140.8826345'
data-group='1'
data-color='0288D1'
data-placeid='ChIJv5YzVhgoil8REpUa4cq3PoE'>
Kotora S-PAL Sendai (みちのく吟撰牛一頭買い 焼肉仔虎)
</option>
<option value='38.2637388,140.8757801'
data-group='1'
data-color='0288D1'
data-placeid='ChIJr5Y7UTMpil8Ro1s7N9xMfzk'>
DATENARI Honcho (本町焼肉)
</option>
<option value='38.2616972,140.8719332'
data-group='1'
data-color='0288D1'
data-placeid='ChIJU8ss9vopil8RA49ZWKG44u0'>
Yakiniku Gyujin Ichibancho (炭火焼肉 牛仁)
</option>
<option value='38.2610693,140.8819013'
data-group='1'
data-color='0288D1'
data-placeid='ChIJIQAgjxgoil8RSyrcFeD6P_I'>
Zenjiro Sendai Station Gyutan Dori (たんや善治郎)
</option>
<option value='38.2648531,140.8698696'
data-group='1'
data-color='0288D1'
data-placeid='ChIJJ8ESVSUoil8R6BhzzI5ceYs'>
Umami Tasuke (旨味 太助)
</option>
<option value='38.259334,140.8830957'
data-group='1'
data-color='673AB7'
data-placeid='ChIJQ7txiRgoil8RvrKh9temhPI'>
Jiichiro Esuparusendaiten (治一郎 エスパル)
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 col-xs-1 control-label" for="to">To:</label>
<div class="col-sm-11 col-xs-11">
<select id="to" class="form-control">
<option value="" data-color="#d3a">Current Location</option>
<option value='38.137184,140.9286618'
data-group='0'
data-color='FF5252'
data-placeid='ChIJ7bSZJT8iil8RxJqVJ_Z_wFQ'>
Sendai-Airport Station
</option>
<option value='38.2600425,140.8834764'
data-group='0'
data-color='FF5252'
data-placeid='ChIJ3zGS2hcoil8RmU5rtjXj4qQ'>
Hotel Metropolitan Sendai East
</option>
<option value='38.0408293,140.5303604'
data-group='0'
data-color='000000'
data-placeid='ChIJndjr2RJEil8R2SPai0gx0Fk'>
Zaō Fox Village (宮城蔵王キツネ村)
</option>
<option value='38.0027452,140.6173369'
data-group='0'
data-color='000000'
data-placeid='ChIJ4bmECBtCil8RYWCNb5SOxgs'>
Shiroishi Castle (白石城跡)
</option>
<option value='38.1616009,140.3952205'
data-group='0'
data-color='000000'
data-placeid='ChIJ9dVANwtLil8RLCyvTtj8TAU'>
Zao Ropeway Zao Sanroku Station (蔵王ロープウェイ 蔵王山麓駅)
</option>
<option value='38.5706177,140.5305457'
data-group='0'
data-color='000000'
data-placeid='ChIJq6pT2NpdiV8RJBQqpNQEx6M'>
Ginzan Onsen Tourist Information Center (銀山温泉案内所)
</option>
<option value='38.309597,140.4347332'
data-group='0'
data-color='000000'
data-placeid='ChIJ9YZe3u7Oi18RwMuiposzJjY'>
Yamadera Station (山寺駅)
</option>
<option value='38.259364,140.8826345'
data-group='1'
data-color='0288D1'
data-placeid='ChIJv5YzVhgoil8REpUa4cq3PoE'>
Kotora S-PAL Sendai (みちのく吟撰牛一頭買い 焼肉仔虎)
</option>
<option value='38.2637388,140.8757801'
data-group='1'
data-color='0288D1'
data-placeid='ChIJr5Y7UTMpil8Ro1s7N9xMfzk'>
DATENARI Honcho (本町焼肉)
</option>
<option value='38.2616972,140.8719332'
data-group='1'
data-color='0288D1'
data-placeid='ChIJU8ss9vopil8RA49ZWKG44u0'>
Yakiniku Gyujin Ichibancho (炭火焼肉 牛仁)
</option>
<option value='38.2610693,140.8819013'
data-group='1'
data-color='0288D1'
data-placeid='ChIJIQAgjxgoil8RSyrcFeD6P_I'>
Zenjiro Sendai Station Gyutan Dori (たんや善治郎)
</option>
<option value='38.2648531,140.8698696'
data-group='1'
data-color='0288D1'
data-placeid='ChIJJ8ESVSUoil8R6BhzzI5ceYs'>
Umami Tasuke (旨味 太助)
</option>
<option value='38.259334,140.8830957'
data-group='1'
data-color='673AB7'
data-placeid='ChIJQ7txiRgoil8RvrKh9temhPI'>
Jiichiro Esuparusendaiten (治一郎 エスパル)
</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-11 col-sm-offset-1 col-xs-11 col-xs-offset-1">
<div class="radio">
<label class="radio-inline">
<input type="radio" name="mode" value="1" checked> Transit
</label>
<label class="radio-inline">
<input type="radio" name="mode" value="2"> Driving
</label>
<label class="radio-inline">
<input type="radio" name="mode" value="3"> Walking
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-xs-12">
<button class="btn btn-primary btn-block" type="button" id="route">Route</button>
</div>
</div>
</form>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-screenshot"></span> Map Directions
</h3>
</div>
<div class="panel-body">
<div><span class="label">Apple</span><span id="apple">No Route Yet</span></div>
<div><span class="label">Google</span><span id="google">No Route Yet</span></div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-exclamation-sign"></span> Place Info
</h3>
</div>
<div class="panel-body">
<div id="map"></div>
</div>
</div>
</div>
<script>
var from_html = $('#from').html();
var to_html = $('#to').html();
// var icon_colors = ['4E342E','0288D1','558B2F','673AB7','E65100'];
$('.nav-pills a').on('click', function (event) {
event.preventDefault();
var group = $(this).data('group');
$(this).closest('li').toggleClass('active');
$('#from').html(from_html).change();
$('#to').html(to_html);
$('li:not([class^="active"])').each(function () {
var hide_group = $(this).find('a').data('group');
$(`option[data-group="${hide_group}"]`).remove();
});
});
$('#from, #to, [name="mode"]').on('click', function () {
$('#apple').empty().append('No Route Yet');
$('#google').empty().append('No Route Yet');
});
$('#route').on('click', function () {
var from_value = $('#from').val();
var from_text = $('#from option:selected').text();
var from_color = $('#from option:selected').data('color');
var to_value = $('#to').val();
var to_text = $('#to option:selected').text();
var to_color = $('#to option:selected').data('color');
var mode = $('[name="mode"]:checked').val();
var href_text = `
<span class="glyphicon glyphicon-map-marker"></span>
<span style='color: #${from_color};'>${from_text}</span>
<span class="glyphicon glyphicon-arrow-right"></span>
<span class="glyphicon glyphicon-map-marker"></span>
<span style='color: #${to_color};'>${to_text}</span>
`;
var mode_apple = 'r';
var mode_google = 'transit';
if (mode == 2) { mode_apple = 'd'; mode_google = 'driving'; }
else if (mode == 3) { mode_apple = 'w'; mode_google = 'walking'; }
var api_apple = `http://maps.apple.com/?saddr=${from_value}&daddr=${to_value}&dirflg=${mode_apple}`;
var api_google = `https://www.google.com/maps/dir/?api=1&origin=${from_value}&destination=${to_value}&travelmode=${mode_google}`;
$('#apple').empty().append(`<a href="${api_apple}" target="_blank">${href_text}</a>`);
$('#google').empty().append(`<a href="${api_google}" target="_blank">${href_text}</a>`);
});
$('#from').on('change', function () {
var location = $(this).val();
var geocode = location.split(',');
var place_name = $(this).find('option:selected').text();
// var color = $(this).find('option:selected').data('color');
var place_id = $(this).find('option:selected').data('placeid') || '';
// if (icon_colors.indexOf(color) < 0) { color = 'E65100'; }
if (geocode.length == 2) {
var map = new google.maps.Map($('#map')[0], {
center: {lat: Number(geocode[0]), lng: Number(geocode[1])},
zoom: 19
});
if (place_id) {
var infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.getDetails({ placeId: place_id }, function (place, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
// icon: {
// url: `images/icon-${color}.png`,
// size: new google.maps.Size(35, 35),
// origin: new google.maps.Point(0, 0),
// anchor: new google.maps.Point(17, 34),
// scaledSize: new google.maps.Size(35, 35)
// }
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(`
<div>
<strong>${place_name}</strong><br />
Rating: <strong>${place.rating}</strong><br />
<a href="${place.url}" target="_blank">View on Google Maps</a>
</div>
`);
infowindow.open(map, this);
});
}
});
}
} else {
$('#map').empty();
}
});
</script>
</body>
</html>