-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
289 lines (273 loc) · 7.86 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Heatmap-ify</title>
<link rel="StyleSheet" href="resources/style.css" type="text/css" />
<link rel="StyleSheet" href="resources/leaflet.css" type="text/css" />
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@ODILeeds">
<meta name="twitter:url" property="og:url" content="https://odileeds.github.io/heatmapify/">
<meta name="twitter:title" property="og:title" content="Heatmap-ify">
<meta name="twitter:description" property="og:description" content="Convert a GeoJSON file into a heatmap">
<meta name="twitter:image" property="og:image" content="https://odileeds.org/resources/images/odileeds.png">
<style>
#contents {
height: 600px;
display: block;
width: 100%;
}
.leaflet-popup-content h3 { margin-top: 0px; }
textarea, #map, td, th, table {
border: 1px solid #cccccc;
}
.dropzone {
border: 2px dashed #999999;
border-radius: 5px;
color: #333333;
padding: 25px;
text-align: center;
position: relative;
}
.dropzone.loaded {
border: 2px solid #333333;
color: #333333;
}
.dropzone.loaded .helpertext {
display: none;
}
.dropzone.drop {
background-color: #ddd;
}
.dropzone input {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
opacity: 0;
}
.glory .holder, .glory-opacity {
height: auto;
}
.table-holder {
overflow-x: auto;
width: 100%;
}
#schema textarea, #schema_file { margin-bottom: 16px; }
h2, h3 { margin-top: 48px; }
table {
max-height: 400px; overflow: scroll;
border-collapse: collapse;
}
table th, table .rownum {
background-color: #ccc;
color: black;
text-align: center;
font-weight: 700;
}
table td {
white-space: nowrap;
overflow: hidden;
color: black;
}
table tr.nogeo {
background-color: rgba(214, 3, 3,0.2);
}
table tr.nogeo td {
color: #777;
}
table td, table th {
padding: 4px;
border: 1px solid #ccc;
border-right: 1px solid #aaa;
min-width: 150px;
}
table td:first-child, table th:first-child {
min-width: auto;
text-align: center;
}
.block {
min-height: auto;
}
input, select {
font-size: 1em;
width: 100%;
}
td.number, th.number {
text-align: center;
}
textarea {
width: 100%;
min-height: 15em;
padding: 6px;
}
table .constraint label { width: auto; display: inline-block; }
table .constraint select { width: auto; display: inline-block; }
table button {
padding: 2px 4px;
margin-left: 2px;
}
#main .seasonal .holder { position: relative; }
.label {
display: block;
position: absolute;
top: -4px;
right: 0em;
font-size: 0.75em;
font-weight: bold;
background-color: black;
padding: 4px 8px 2px 8px;
border-radius: 0.25em;
vertical-align: baseline;
white-space: nowrap;
color: white;
}
#validate {
display: none;
}
.checked:before {
content: "✓";
color: #1dd3a7;
font-size: 2em;
left: -0.5em;
position: absolute;
}
.processing:before {
content: "⧗";
color: #00B6FF;
font-size: 2em;
left: -0.5em;
position: absolute;
}
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
#map .marker-group {
border-radius: 100%;
text-align: center;
line-height: 40px;
}
</style>
<script type="text/javascript" src="resources/stuquery.js"></script>
<script type="text/javascript" src="resources/grid.js"></script>
<script type="text/javascript" src="resources/leaflet.js"></script>
</head>
<body>
<header class="b1-bg">
<div class="b1-bg glory">
<div class="glory-opacity">
<div class="holder">
<a href="http://odileeds.org/"><img alt="ODI Leeds" src="resources/odileeds.svg" title="ODI Leeds"></a>
</div>
</div>
</div>
</header>
<div id="main">
<div class="seasonal">
<div class="holder">
<h1>Heatmap-ify</h1><span class="label">ALPHA</span>
</div>
</div>
<div class="holder">
<form id="validation_form" method="post" enctype="multipart/form-data" action="#" accept-charset="UTF-8">
<input id="no_js" type="hidden" name="no_js" value="1" />
<input type="hidden" value="✓" name="utf8">
<input type="hidden" name="urls[]" value="" />
<input type="hidden" name="urls[]" value="" />
<input type="hidden" name="files[]" value="" />
<p>Generate a GeoJSON heatmap from a GeoJSON file in three easy steps. The heatmap will be made by summing up the number of GeoJSON points that fall in each grid cell.</p>
<h2 class="step1">1. Select a GeoJSON file</h2>
<p>We'll only work with it within your browser so you don't need to worry about anything getting uploaded.</p>
<div id="drop_zone" class="dropzone block">
<div class="helpertext">
Drop GeoJSON file here (or click to browse files)<br />
<input id="standard_files" class="fileselect" type="file" title="browse" name="files[]" multiple="multiple" accept=".geojson">
</div>
</div>
<output id="list"></output>
<h2 class="step2">2. Heatmap</h2>
<p>The result of heatmapping your file appears on the map below.</p>
<label for="gridsize">Grid size (m)</label><input type="number" value="150" id="gridsize" />
<output id="contents"></output>
<h2 class="step3">3. Save the result</h2>
<output id="geojson">
<textarea></textarea>
<div id="filesize"></div>
</output>
<p><button type="button" id="save" class="seasonal">Save as GeoJSON</button> or copy and paste the output into a file with a .geojson extension.</p>
</form>
</div>
</div>
<footer class="b1-bg">
<div class="holder">
Created by Stuart Lowe, <a href="http://odileeds.org/projects/">ODI Leeds</a> 2019. Find <a href="https://github.com/odileeds/heatmapify/">the code on Github</a>.
</div>
</footer>
</body>
</html>