-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathelevation.html
More file actions
447 lines (387 loc) · 12.4 KB
/
Copy pathelevation.html
File metadata and controls
447 lines (387 loc) · 12.4 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
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title> Elevation along Path </title>
<!-- Include the style sheet for the ThinkGeo VectorMap.js library from our CDN. -->
<link rel="stylesheet" href="https://cdn.thinkgeo.com/vectormap-js/3.0.0/vectormap.css">
<!-- Define some custom styles for the UI of our sample page. -->
<style rel="stylesheet" type="text/css">
#map {
width: 100%;
height: calc(75% - 5px);
position: relative;
background-color: #fff;
}
.ol-control button {
height: 1.2em !important;
width: 1.2em !important;
border: solid 1px #ccc;
font-size: 1.5em !important;
background-color: #fff !important;
color: #2d3c4d;
cursor: pointer;
border-radius: 2px;
}
.ol-control button:focus {
outline: unset;
}
.ol-full-screen {
right: unset;
left: 0.5em;
top: 5.5em;
}
.style-btn-group {
top: 1rem;
right: 50px;
position: absolute;
z-index: 999;
display: flex;
}
.style-btn-group button {
width: 55px;
height: 28px;
background-color: #fff;
color: #2d3c4d;
border: 1px solid #ccc;
outline: none;
cursor: pointer;
}
.style-btn-group .current {
background-color: #efefef;
}
#chart {
width: 100%;
padding-top: 5px;
height: 25%;
z-index: 1000;
background: #2D3035;
}
#side-bar {
right: 0;
background-color: rgba(38, 40, 44, 0.85);
color: #ccc;
position: absolute;
bottom: 0;
padding: 0.6rem;
box-shadow: -2px -2px 4px rgba(0, 0, 0, .2);
border-top-left-radius: 5px;
z-index: 1000;
}
#side-bar input {
line-height: 1.42857;
color: #555;
background-color: #fff;
-webkit-appearance: none;
border-radius: 10px;
}
#side-bar input:focus {
border-color: #66afe9;
outline: 0;
}
input[type=range]::-webkit-slider-runnable-track {
height: 12px;
border-radius: 10px;
box-shadow: 0 0 1px #def3f8, inset 0 0 .125em #0d1112;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
margin-top: 1px;
height: 10px;
width: 10px;
background: #808080;
border-radius: 50%;
border: solid 0.125em rgba(53, 53, 53, 0.5);
box-shadow: 0 .125em .125em #3b4547;
}
#side-bar label {
display: inline-block;
width: 170px;
margin: 6px 0;
}
#chartContainer {
z-index: 1000;
}
.btn-wrap {
width: 100%;
text-align: right;
}
.buttonDraw {
display: inline-block;
padding: 2px 10px;
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.428571429;
text-align: right;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 1px solid #357ebd;
border-radius: 4px;
color: #fff;
background-color: #428bca;
}
.drawline {
position: absolute;
top: 1rem;
right: 10px;
padding: 0;
background-color: rgba(255, 255, 255, 0);
border: 1px solid #ccc;
}
.drawline button {
background-color: #fff;
background-image: url('../image/line.png');
background-size: 80%;
background-position: center;
background-repeat: no-repeat;
border-style: none;
border: none;
width: 25px;
height: 25px;
cursor: pointer;
}
.drawline button:focus,
.drawline button:hover {
background-color: #fff;
}
.drawline button.on {
background-color: #f2c021;
}
#samples-number {
width: 200px;
}
.info {
position: relative;
display: inline-block;
width: 14px;
height: 14px;
font-size: 13px;
text-align: center;
border-radius: 50%;
color: rgb(48, 48, 48);
background-color: #fff;
font-weight: bolder;
cursor: pointer;
}
.info p {
display: inline-block;
position: absolute;
width: 200px;
height: auto;
background-color: #fff;
padding: 15px 12px;
bottom: 14px;
left: -100px;
text-align: left;
word-spacing: 1px;
border-radius: 5px;
cursor: default;
}
.info p::after {
position: absolute;
display: inline-block;
width: 0;
height: 0;
content: '';
border-width: 8px;
border-color: transparent;
border-style: solid;
border-top-color: #fff;
bottom: -16px;
left: calc(50% - 13px);
}
.close {
width: 10px;
height: 10px;
position: absolute;
top: 0;
right: 5px;
text-align: center;
cursor: pointer;
}
.hide {
display: none !important;
}
.map-tip {
position: absolute;
left: 10px;
bottom: -10px;
opacity: 0;
background-color: rgba(38, 40, 44, 0.85);
color: #ccc;
z-index: 990;
font-size: 13px;
padding: 5px 10px;
transition: bottom 400ms ease-out, opacity 400ms ease-out;
}
.map-tip.visible {
bottom: 10px;
opacity: 1;
}
#error-modal {
position: fixed;
top: 0;
height: 100%;
width: 100%;
z-index: 99;
background-color: #0000006e;
}
.modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 600px;
height: auto;
text-align: right;
padding: 10px;
border-radius: 5px;
font-size: 1.1rem;
line-height: 1.5;
background-color: #f0f0f0;
border: 1px solid #b8b8b8;
}
.modal-content p {
text-align: left;
}
.modal-content button {
color: #fff;
background-color: #3d3d3e;
border-color: #3d3d3e;
border-radius: 4px;
padding: 0 7px;
height: 30px;
width: 60px;
cursor: pointer;
margin-right: 20px;
}
.hide {
display: none;
}
@media screen and (max-width: 767px) {
#chart {
height: 20%;
}
#map {
height: calc(80% - 27px);
}
#side-bar {
padding: 0;
background-color: transparent;
}
#side-bar label {
width: 130px;
margin: 5px 0;
font-size: 12px;
}
#samples-number {
width: 170px;
}
#places {
font-size: 11px
}
.btn-wrap .buttonDraw {
font-size: 12px;
padding: 0 5px;
}
input[type=range]::-webkit-slider-runnable-track {
height: 10px;
}
input[type=range]::-webkit-slider-thumb {
margin-top: 0;
height: 10px;
width: 10px;
}
.preset-paths-panel>label,
.num-samples-panel,
.btn-wrap {
display: none !important;
}
.preset-paths-panel select {
background-color: rgb(65, 65, 65);
color: #fff;
border: none;
padding: 0.3rem;
}
.preset-paths-panel select:focus {
outline: none;
}
.modal-content {
width: 80vw;
}
}
@media screen and (max-width: 481px) {
.map-tip {
max-width: 100px;
}
}
</style>
</head>
<body>
<!-- This <div> is the container into which our map control will be loaded. -->
<div id="map">
<!-- This <div> is the container into which our control panels will be rendered. -->
<div id="side-bar">
<div class="preset-paths-panel">
<label for="places">Preset Paths:</label>
<select id="places">
<option value="place1">San Francisco - Coit Tower</option>
<option value="place2">Arizona Meteor Crater</option>
<option value="place3">Mount Rainier Path to Summit</option>
<option value="place4">Colorado River from Hoover Dam</option>
</select>
</div>
<div class="num-samples-panel">
<label for="samples-number">Number of Samples:
<span class="info">i
<p class="hide">The number of samples determines how many elevation readings will be taken
along the path
that you’ve drawn. A higher number of samples results in a more accurate overall elevation
result.
<span class="close">x</span>
</p>
</span>
</label>
<input type="range" data-option="hard-light" min="1" max="30" value="15" step="1" id="samples-number">
</div>
<div class="btn-wrap">
<button tabindex="4" class="buttonDraw">Draw New Path</button>
</div>
</div>
<div class="style-btn-group">
<button value="dark">Dark</button>
<button class="current" value="hybrid">Hybrid</button>
<button value="light">Light</button>
</div>
<div class="map-tip">
Hint: Double-tap to end drawing.
</div>
<!-- Set up error message tip. -->
<div id="error-modal" class="hide">
<div class="modal-content">
<p>We're having trouble communicating with the ThinkGeo Cloud. Please check the API key being used in
this
sample's JavaScript source code, and ensure it has access to the ThinkGeo Cloud services you are
requesting. You can create and manage your API keys at <a href="https://cloud.thinkgeo.com"
target="_blank" rel="noopener">https://cloud.thinkgeo.com</a>.</p>
<button>OK</button>
</div>
</div>
</div>
<!-- This <div> is the container into which our diagram will be rendered. -->
<div id="chart">
<canvas id="chartContainer"></canvas>
</div>
<!-- Include the latest version of ThinkGeo's VectorMap.js library from our CDN. -->
<script src="https://cdn.thinkgeo.com/vectormap-js/3.0.0/vectormap.js"></script>
<!-- Include the latest version of ThinkGeo's Cloud Client library from our CDN. -->
<script src="https://cdn.thinkgeo.com/cloudclient-js/1.0.4/thinkgeocloudclient.js"></script>
<!-- Load the Chart library dependency for diagrammatic presentation. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<script src="../js/elevation.js"></script>
</body>
</html>