forked from awoodruff/contours
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.html
More file actions
455 lines (435 loc) · 15.7 KB
/
index.html
File metadata and controls
455 lines (435 loc) · 15.7 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
448
449
450
451
452
453
454
455
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-54392712-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-54392712-6');
</script>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700" rel="stylesheet">
<link href='https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.css' rel='stylesheet' />
<link rel="stylesheet" href="css/fontello.css" />
<meta charset="utf-8">
<script src='https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.js'></script>
<script src="lib/leaflet-hash.js"></script>
<script src="https://d3js.org/d3-selection.v1.min.js"></script>
<script src="https://d3js.org/d3-contour.v1.min.js"></script>
<script src="https://d3js.org/d3-geo.v1.min.js"></script>
<script src="https://d3js.org/d3-array.v1.min.js"></script>
<script src="https://d3js.org/d3-collection.v1.min.js"></script>
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-scale.v2.min.js"></script>
<script src="https://d3js.org/d3-request.v1.min.js"></script>
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script>
<script src="jscolor.js"></script>
<style>
html, body {
margin: 0;
font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
font-size: 14px;
color: #111;
}
#wrapper {
position: relative;
}
#map {
width: 100%;
height: 100%;
}
header {
background-color: rgb(88,87,72);
color: white;
-webkit-text-fill-color: rgb(88,87,72);
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: white;
height: 30px;
line-height: 30px;
font-size: 20px;
text-align: center;
font-weight: bold;
position: fixed;
width: 100%;
z-index: 5000;
}
#panels {
position: absolute;
top: 30px;
left: -300px;
width: 300px;
height: calc(100% - 30px);
transition: left .5s;
z-index: 1000;
background-color: white;
box-sizing: border-box;
box-shadow: 0 0 5px rgba(0,0,0,.5);
overflow: auto;
}
.panel-open #panels {
left: 0;
}
#settings, #download {
min-height: 100%;
width: 100%;
box-sizing: border-box;
position: absolute;
top: 0;
left: 0;
background-color: white;
padding-right: 20px;
}
#download.show + #settings {
display: none;
}
.toggle {
position: absolute;
z-index: 1001;
left: 0px;
top: 40px;
background-color: rgb(88,87,72);
color: white;
cursor: pointer;
font-size: 20px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
transition: left .5s;
width: 50px;
height: 50px;
box-shadow: 2px 0 2px rgba(0,0,0,.5);
display: flex;
align-items: center;
justify-content: center;
}
.toggle.show {
color: rgb(88,87,72);
background-color: white;
}
.toggle:hover {
color: #333;
}
.panel-open .toggle {
left: 300px;
}
.leaflet-left {
left: 60px;
transition: left .5s;
top: 30px;
}
.panel-open .leaflet-left {
left: 360px;
}
#download-toggle {
top: 100px;
}
.settings-title {
margin: 0 0 20px 0;
font-size: 1.1rem;
color: #333;
vertical-align: middle;
background-color: rgb(237,237,226);
padding: 5px 20px;
}
.settings-row {
margin-bottom: 25px;
}
.settings-section {
margin-bottom: 20px;
display: flex;
align-items: center;
}
.settings-section > span {
flex-grow: 1;
}
.settings-content {
padding-left: 20px;
}
.color-section {
margin: 20px 0 20px 20px;
}
#settings > label {
margin: 20px 0 10px 20px;
display: block;
}
label.bg, label.type {
display: block;
margin-bottom: 20px;
}
button[type="color"], div.row-icon {
margin-right: 20px;
width: 45px;
height: 20px;
display: inline-block;
}
input[type="checkbox"]{
margin-bottom: 15px;
}
input[type="radio"] {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
input[type="radio"] + span{
color: #999;
cursor: pointer;
padding: 5px;
border-radius: 5px;
min-width: 20px;
display: inline-block;
width: calc(100% - 10px);
}
input[type="radio"] + span:hover{
background-color: #f7f7f7;
}
input[type="radio"]:checked + span{
color: #111;
font-weight: bold;
background-color: #58A2D8;
color: white;
}
input[type="radio"][name="unit"] + span{
width: auto;
text-align: center;
}
#settings input[type="text"] {
width: 40px;
font-size: 12px;
padding: 5px;
text-align: center;
border-radius: 5px;
border: 1px solid #ccc;
}
#settings input[type="text"].color-input {
width: 80px;
}
#settings input#interval-input {
width: 50px;
}
canvas {position: absolute; top:0; left:0;}
.leaflet-container{ background: white;}
div.disabled {
opacity: .1;
}
div.disabled {
display: none;
}
#download em {
color: #b76868;
font-size: 12px;
display: inline-block;
margin-top: 5px;
}
#download .note {
width: 85%;
}
.download-button {
border: 1px solid #111;
border-radius: 3px;
margin-top: 20px;
cursor: pointer;
padding: 5px;
-webkit-appearance: none;
appearance: none;
display: block;
font-size: 14px;
}
.download-button:hover {
background-color: #eee;
}
#search {
position: absolute;
top: 40px;
right: 20px;
z-index: 500;
box-shadow: 0 0 10px rgba(0,0,0,.5);
}
#search input {
width: 300px;
padding: 10px;
display: block;
}
#search-results {
display: none;
width: 300px;
background-color: white;
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
}
.search-result {
padding: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.search-result:hover, .search-result.highlight {
background-color: #eee;
}
.icon-left-open {
position: absolute;
top: 25px;
right: 20px;
color: rgb(88,87,72);
cursor: pointer;
font-size: 14px;
}
.icon-left-open:hover {
color: #333;
}
#loading {
width: 100%;
height: 100%;
line-height: 100%;
position: absolute;
z-index: 2000;
background-color: rgba(255,255,255,.75);
font-size: 72px;
color: rgb(88,87,72);
text-align: center;
display: flex;
top: 0;
left: 0;
justify-content: center;
align-items: center;
}
#axis-link{
position: absolute;
left: 10px;
bottom: 10px;
z-index: 9999;
}
</style>
</head>
<body>
<a id="axis-link" href="www.axismaps.com" target="_blank"><img src="https://www.axismaps.com/images/logo_small.png"></a>
<div id='wrapper'>
<header>CONTOURS</header>
<div id='map'></div>
<div id="panels">
<div id="download">
<i class="icon-left-open"></i>
<div class="settings-content note"><br><em>Roads and labels are provided only for helping find your area of interest on this map. They will not be inlcuded in downloads.</em><br><br></div>
<div class='settings-row geojson'>
<p class="settings-title"><i class="icon-download"></i> GeoJSON</p>
<div class="settings-content">Download contours for use in GIS or mapping applications. Contours will be exported as overlapping <code>MultiPolygon</code> features, each with an <code>elevation</code> property.<br><em>Geodata only. Styles will not be included!</em>
<button class="download-button" id="download-geojson">
<i class="icon-download"></i> Download GeoJSON
</button>
</div>
</div>
<div class='settings-row png'>
<p class="settings-title">PNG image</p>
<div class="settings-content">Download a raster image of the map, including your chosen styles.
<button class="download-button" id="download-png">
<i class="icon-download"></i> Download PNG
</button>
</div>
</div>
<div class='settings-row svg'>
<p class="settings-title">SVG</p>
<div class="settings-content">Download contours as vector graphics.<br><em>This does not work well for illuminated contours! It will export polygons, but you'll have better luck achieving the effect in your favorite graphics editing software.</em>
<button class="download-button" id="download-svg">
<i class="icon-download"></i> Download SVG
</button>
</div>
</div>
</div>
<div id='settings'>
<i class="icon-left-open"></i>
<label><input type="checkbox" checked> Show roads and labels</input></label>
<div class='settings-row type'>
<p class="settings-title inline">Map Type</p>
<div class="settings-content">
<label class="type"><input type="radio" name="type" checked value="lines"/><span>Contour lines</span></label>
<label class="type"><input type="radio" name="type" value="illuminated"/><span>Illuminated contour polygons</span></label>
</div>
</div>
<div class='settings-row unit'>
<p class="settings-title">Contour Interval</p>
<div class="settings-content">
<div class="settings-section">
<div class="row-icon"><img src="img/icon_contours.png"/></div>
<input type="text" value="500" id="interval-input"/>
<span></span>
<label><input type="radio" name="unit" value="m"/><span>meters</span></label>
<label><input type="radio" name="unit" checked value="ft"/><span>feet</span></label>
</div>
<div class="settings-section">
<div class="row-icon"><img src="img/icon_major.png"/></div>
<span>Index line interval</span>
<select id="major">
<option value="0">None</option>
<option value="2"></option>
<option value="5"></option>
<option value="10"></option>
</select>
</div>
</div>
</div>
<div class='settings-row'>
<p class="settings-title">Contour Style</p>
<div class="settings-content">
<div id="lines-style">
<div class="settings-section"><button id="line-color" type="color" value ="#8c7556"></button><span>Contour color</span><label><input class="color-input" id="line-color-text" type="text" value ="#8c7556"/></label></div>
<div class="settings-section"><div class="row-icon"><img src="img/icon_weight.png"/></div><span>Line weight</span><label><input id="line-width" type="text" value="0.75"/> px</label></div>
<div class="settings-section"><div class="row-icon"><img src="img/icon_weight_major.png"/></div><span>Index line weight</span><label><input id="line-width-major" type="text" value="1.5"/> px</label></div>
</div>
<div id="illuminated-style" style="display: none">
<div class="settings-section"><button id="highlight-color" type="color" value ="#fffbec"></button><span>Highlight color</span><label><input class="color-input" id="highlight-color-text" type="text" value ="#fffbec"/></label></div>
<div class="settings-section"><button id="shadow-color" type="color" value ="#5b5143"></button><span>Shadow color</span><label><input class="color-input" id="shadow-color-text" type="text" value ="#5b5143"/></label></div>
<div class="settings-section"><div class="row-icon"><img src="img/icon_weight.png"/></div><span>Width</span><label><input id="shadow-width" type="text" value="2"/> px</label></div>
</div>
</div>
</div>
<div class='settings-row'>
<p class="settings-title">Background style</p>
<div class="settings-content">
<label class="bg"><input type="radio" name="bg" checked value="none" id="no-bg"/><span>None</span></label>
<label class="bg"><input type="radio" name="bg" value="solid" id="solid-bg"/><span>Solid color</span></label>
<div id="solid-style" class="settings-section disabled color-section">
<button id="solid-color" type="color" value ="#fffcfa"></button><span>Fill color</span><label><input class="color-input" id="solid-color-text" type="text" value ="#fffcfa"/></label>
</div>
<label class="bg"><input type="radio" name="bg" value="hypso"/><span>Hypsometric tints</span></label>
<div id="hypso-style" class="disabled">
<div class="settings-section color-section">
<button id="hypso-low-color" type="color" value ="#79a483"></button><span>Low color</span><label><input class="color-input" id="hypso-low-color-text" type="text" value ="#79a483"/></label>
</div>
<div class="settings-section color-section">
<button id="hypso-high-color" type="color" value ="#ffdecb"></button><span>High color</span><label><input class="color-input" id="hypso-high-color-text" type="text" value ="#ffdecb"/></label>
</div>
</div>
</div>
</div>
<div class='settings-row inline' id="bathymetry">
<p class="settings-title">Bathymetry</p>
<div class="settings-content">
<label class="bg"><input type="radio" name="bathy" checked value="none" id="no-bathy"/><span>None</span></label>
<label class="bg"><input type="radio" name="bathy" value="solid" id="solid-bathy"/><span>Solid color</span></label>
<div id="solid-bathy-style" class="settings-section disabled color-section">
<button id="solid-bathy-color" type="color" value ="#d5f2ff"></button><span>Fill color</span><label><input class="color-input" id="solid-bathy-color-text" type="text" value ="#d5f2ff"/></label>
</div>
<label class="bg"><input type="radio" name="bathy" value="bathy"/><span>Bathymetric tints</span></label>
<div id="bathy-style" class="disabled">
<div class="color-section settings-section">
<button id="bathy-low-color" type="color" value ="#315d9b"></button><span>Low color</span><label><input class="color-input" id="bathy-low-color-text" type="text" value ="#315d9b"/></label>
</div>
<div class="color-section settings-section">
<button id="bathy-high-color" type="color" value ="#d5f2ff"></button><span>High color</span><label><input class="color-input" id="bathy-high-color-text" type="text" value ="#d5f2ff"/></label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="toggle" id="settings-toggle" title="Edit style"><i class="icon-brush"></i></div>
<div class="toggle" id="download-toggle" title="Download map or data"><i class="icon-download"></i></div>
<div id="search">
<input type="text" placeholder="Search for places..." />
<div id="search-results"></div>
</div>
</div>
<div id="loading">Drawing contours...</div>
<script src='contours.js'></script>
</body>
</html>