-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path10_1_mapbox.html
More file actions
372 lines (344 loc) · 13.3 KB
/
10_1_mapbox.html
File metadata and controls
372 lines (344 loc) · 13.3 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>9_1_mapbox testing</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.css' rel='stylesheet' />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#map {
position: fixed;
width: 50%;
}
#features {
width: 50%;
margin-left: 50%;
font-family: sans-serif;
overflow-y: scroll;
background-color: #fafafa;
}
section {
padding: 50px 50px;
line-height: 25px;
border-bottom: 1px solid #ddd;
opacity: 0.25;
font-size: 13px;
}
section.active {
opacity: 1;
}
section:last-child {
border-bottom: none;
margin-bottom: 200px;
}
.space {
min-height: 600px;
}
</style>
</head>
<body>
<div id='map'></div>
<div id='features'>
<section id='circle_1' class='active'>
<h3>東門圓環->羅斯福路直行</h3>
<p>November 1895. London is shrouded in fog and Sherlock Holmes and Watson pass time restlessly awaiting a new case. "The London criminal is certainly a dull fellow," Sherlock bemoans. "There have been numerous petty thefts," Watson offers in response. Just then a telegram arrives from Sherlock's brother Mycroft with a mysterious case.</p>
</section>
<section id='QDER_2'>
<h3>青島東路->右轉</h3>
<p>Arthur Cadogan West was found dead, head crushed in on train tracks at Aldgate Station at 6AM Tuesday morning. West worked at Woolwich Arsenal on the Bruce-Partington submarine, a secret military project. Plans for the submarine had been stolen and seven of the ten missing papers were found in West's possession. Mycroft implores Sherlock to take the case and recover the three missing papers.</p>
</section>
<section id='LSSR_3'>
<h3>林森南路口->左轉</h3>
<p>Holmes and Watson's investigations take them across London. Sherlock deduces that West was murdered elsewhere, then moved to Aldgate Station to create the illusion that he was crushed on the tracks by a train. On their way to Woolwich Sherlock dispatches a telegram to Mycroft at London Bridge: "Send list of all foreign spies known to be in England, with full address."</p>
</section>
<section id='ZXER_4'>
<h3>忠孝東路->右轉</h3>
<p>While investigating at Woolwich Arsenal Sherlock learns that West did not have the three keys—door, office, and safe—necessary to steal the papers. The train station clerk mentions seeing an agitated West boarding the 8:15 train to London Bridge. Sherlock suspects West of following someone who had access to the Woolwich chief's keyring with all three keys.</p>
</section>
<section id='SSSR_5'>
<h3>新生南路->右轉</h3>
<p>Mycroft responds to Sherlock's telegram and mentions several spies. Hugo Oberstein of 13 Caulfield Gardens catches Sherlock's eye. He heads to the nearby Gloucester Road station to investigate and learns that the windows of Caulfield Gardens open over rail tracks where trains stop frequently.</p>
</section>
<section id='RIR_6'>
<h3>仁愛路->右轉</h3>
<p>Holmes deduces that the murderer placed West atop a stopped train at Caulfield Gardens. The train traveled to Aldgate Station before West's body finally toppled off. Backtracking to the criminal's apartment, Holmes finds a series of classified ads from <em>The Daily Telegraph</em> stashed away. All are under the name Pierrot: "Monday night after nine. Two taps. Only ourselves. Do not be so suspicious. Payment in hard cash when goods delivered."</p>
</section>
<section id='circle_7'>
<h3>直行至東門圓環</h3>
<p>Holmes and Watson head to The Daily Telegraph and place an ad to draw out the criminal. It reads: "To-night. Same hour. Same place. Two taps. Most vitally important. Your own safety at stake. Pierrot." The trap works and Holmes catches the criminal: Colonel Valentine Walter, the brother of Woolwich Arsenal's chief. He confesses to working for Hugo Oberstein to obtain the submarine plans in order to pay off his debts.</p>
</section>
<section id='end_8'>
<h3>凱道會師</h3>
<p>Walter writes to Oberstein and convinces him to meet in the smoking room of the Charing Cross Hotel where he promises additional plans for the submarine in exchange for money. The plan works and Holmes and Watson catch both criminals.</p>
</section>
<div class="space"></div>
<div class="space"></div>
</div>
<script src="map.js"></script>
</body>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoiamlybG9uZyIsImEiOiJjaXZzNmxtNnEwNDRyMnRxcnhlMWd2eWIzIn0.colQOdSaL2thS6DSM6WsZg';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/jirlong/civs6or6f006y2jrzh4nt17y1',
center: [121.517373, 25.039144],
zoom: 20.05,
bearing: 101.60,
pitch: 50.00
});
map.on('load', function() {
map.addLayer({
'id': '3d-buildings',
'source': 'composite',
'source-layer': 'building',
'filter': ['==', 'extrude', 'true'],
'type': 'fill-extrusion',
'minzoom': 20,
'paint': {
'fill-extrusion-color': '#aaa',
'fill-extrusion-height': {
'type': 'identity',
'property': 'height'
},
'fill-extrusion-base': {
'type': 'identity',
'property': 'min_height'
},
'fill-extrusion-opacity': .6
}
});
map.addSource("route", {
"type": "geojson",
"data": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[
121.51717901229858,
25.03916302063388
],
[
121.51745796203613,
25.039415754053685
],
[
121.51780128479002,
25.039532400071796
],
[
121.51923894882202,
25.0445869542914
],
[
121.52297258377075,
25.043614940813328
],
[
121.52331590652464,
25.044859116684524
],
[
121.53284311294556,
25.04229299011858
],
[
121.53275728225708,
25.038229846572555
],
[
121.52522563934326,
25.03834649371849
],
[
121.51801586151123,
25.039260225856985
],
[
121.51808023452757,
25.03892972778415
],
[
121.51780128479002,
25.038638111097974
],
[
121.5174150466919,
25.038657552231978
],
[
121.51720046997069,
25.03894916887192
]
]
}
}
});
map.addSource('maine', {
'type': 'geojson',
'data': {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
"coordinates": [
[
[
121.51726484298706,
25.038881125051265
],
[
121.51750087738037,
25.038638111097974
],
[
121.5178120136261,
25.03861866996092
],
[
121.52436733245848,
25.03542056096929
],
[
121.52523636817932,
25.038307611348834
],
[
121.51816606521605,
25.039201902732373
],
[
121.51771545410155,
25.039483797577734
],
[
121.517254114151,
25.03922134377699
],
[
121.51726484298706,
25.038881125051265
]
]
]
}
}
});
map.addLayer({
"id": "route",
"type": "line",
"source": "route",
"layout": {
"line-join": "round",
"line-cap": "round"
},
"paint": {
"line-color": "#888",
"line-width": 8
}
});
map.addLayer({
'id': 'maine',
'type': 'fill',
'source': 'maine',
'layout': {},
'paint': {
'fill-color': '#588',
'fill-opacity': 0.8
}
});
});
var chapters = {
'circle_1': {
center: [121.517750, 25.039535],
bearing: 12,
zoom: 20,
pitch: 50.00
},
'QDER_2': {
center: [121.519380, 25.044406],
duration: 6000,
bearing: 12.00,
zoom: 20,
pitch: 50.00
},
'LSSR_3': {
center: [121.522951, 25.043643],
bearing: 101.60,
zoom: 20,
speed: 0.6,
pitch: 50.00
},
'ZXER_4': {
center: [121.523297, 25.044810],
bearing: 9.60,
zoom: 20,
pitch: 50.00
},
'SSSR_5': {
center: [121.529881, 25.043076],
bearing: 107.20,
zoom: 20,
curve: 1,
pitch: 60.00,
speed: 0.5
},
'RIR_6': {
center: [121.528377, 25.038232],
bearing: -169.44,
zoom: 20,
curve: 0.5,
pitch: 60.00
},
'circle_7': {
center: [121.518010, 25.039133],
bearing: -110.40,
zoom: 20,
curve: 0.5,
pitch: 60
},
'end_8': {
center: [121.517227, 25.039141],
bearing: -71.22,
zoom: 20,
curve: 0.5,
pitch: 60.00
}
};
// On every scrolled event, check which element is on screen
window.onscroll = function() {
var chapterNames = Object.keys(chapters);
for (var i = 0; i < chapterNames.length; i++) {
var chapterName = chapterNames[i];
if (isElementOnScreen(chapterName)) {
setActiveChapter(chapterName);
break;
}
}
};
var activeChapterName = 'baker';
function setActiveChapter(chapterName) {
if (chapterName === activeChapterName) return;
map.flyTo(chapters[chapterName]);
document.getElementById(chapterName).setAttribute('class', 'active');
document.getElementById(activeChapterName).setAttribute('class', '');
activeChapterName = chapterName;
}
function isElementOnScreen(id) {
var element = document.getElementById(id);
var bounds = element.getBoundingClientRect();
return bounds.top < window.innerHeight && bounds.bottom > 0;
}
</script>
</html>