/
index.html
303 lines (243 loc) · 8.17 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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<head title="Overabundant Fish Lakes">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-34354121-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-34354121-1');
</script>
<!-- Leaflet Maps -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<link rel="icon" type="image/png" href="trout.png">
<!--<script src="https://code.angularjs.org/1.6.9/angular.js"></script>-->
<!--testing-->
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.3.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.3.0/mapbox-gl.css' rel='stylesheet' />
<link href="styles/multiselect.css" rel="stylesheet"/>
<script src="multiselect.min.js"></script>
<style>
.marker {
width: 250px;
}
.grid-container {
display: grid;
grid-template-columns: auto auto auto auto auto auto auto;
padding: 0px;
}
.grid-item {
border: 0px solid rgba(0, 0, 0, 0.8);
padding: 0px;
font-size: 20px;
text-align: left;
}
</style>
<style>
/* Popup container - can be anything you want */
.popup {
position: relative;
display: inline-block;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* The actual popup */
.popup .popuptext {
visibility: hidden;
width: 250px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 8px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -80px;
}
/* Popup arrow */
.popup .popuptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
/* Toggle this class - hide and show the popup */
.popup .show {
visibility: visible;
-webkit-animation: fadeIn 1s;
animation: fadeIn 1s;
}
/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
from {opacity: 0;}
to {opacity: 1;}
}
@keyframes fadeIn {
from {opacity: 0;}
to {opacity:1 ;}
}
</style>
<style>
.loader {
border: 16px solid #f3f3f3;
border-radius: 50%;
border-top: 16px solid blue;
border-bottom: 16px solid blue;
width: 120px;
height: 120px;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body ng-app="app">
<h1>Explanatory Note</h1>
<p>
This site is a <b>prototype</b> of MapWeaver, a potential web application that
is being developed by
<a href="http://www.fieldcady.com">Field Cady</a>.
There are many datasets in the world where the data is associated with
physical locations, but no tool exists that shows those locations on a map.
This is especially the case with a lot of government datasets, where they
are mandated to make the data available but not required to make it intuitive.
</p>
<p>
MapWeaver is a framework for plotting such
datasets on a map. You can have one dataset or several (with color-coded markers),
and apply different filters to each.
It can be publicly available datasets or ones that are internal to
your organization.
Depending on the datasets you use you can answer questions like:
<ul>
<li>Are there any known water quality violators upstream from a toxic measurement?</li>
<li>Do burglaries and muggings happen in the same areas?</li>
<li>Where have wild fires started recently?</li>
</ul>
The possibilities are endless, and all it takes is pointing and clicking
on a map.
</p>
<p>
Below is a prototype of MapWeaver, showing water quality violations in
Washington state for the past year (from the PARIS dataset).
The goal is to show you the interface and get you thinking about
the possibilities with datasets that are relevant to your industry.
Bear in mind that the production version would have more features
and be prettier; this is intended as a proof of concept.
If this looks intriguing, or if you have feedback, Field can
be reached at field.cady@gmail.com. Thank you for your input!
</p>
<h1>PARIS Violations in Last Year</h1>
<b>Filters:</b>
<br>
<div class="grid-container">
<div class="grid-item">Year:
<select id='yearSelect' multiple>
<option value='2020' selected>2020</option>
</select>
</div>
<div class="grid-item">Category:
<select id='categorySelect' multiple>
<option value='Monitoring Violations' selected>Monitoring Violations</option>
<option value='Effluent Violations' selected>Effluent Violations</option>
<option value='Reporting Violations' selected>Reporting Violations</option>
<option value='Other' selected>Other</option>
</select>
</div>
<div class="grid-item">Permit Type:
<select id='typeSelect' multiple>
<option value='Municipal NPDES IP' selected>Municipal NPDES IP</option>
<option value='Industrial NPDES IP' selected>Industrial NPDES IP</option>
<option value='Industrial (IU) to POTW/PRIVATE SWDP IP' selected>Industrial (IU) to POTW/PRIVATE SWDP IP</option>
<option value='Municipal to ground SWDP IP' selected>Municipal to ground SWDP IP</option>
<option value='Industrial to ground SWDP IP' selected>Industrial to ground SWDP IP</option>
<option value='Sand and Gravel GP' selected>Sand and Gravel GP</option>
<option value='Reclaimed Water IP' selected>Reclaimed Water IP</option>
<option value='Other' selected>Other</option>
</select>
</div>
<div class="grid-item">
Submit:
<button onclick='updateMarkersWithLoader();'>Apply Filters</button>
</div>
</div>
<div class="popup">
<span class="popuptext" id="myPopup">Loading</span>
</div>
<script>
// When the user clicks on div, open the popup
function loaderOn() {
myFunction('show')
}
function loaderOff() {
myFunction('hide')
}
function myFunction(state) {
var popup = document.getElementById("myPopup");
console.log('contains:', popup.classList.contains('show'));
var cur_state = popup.classList.contains('show') ? 'show' : 'hide'
if (cur_state != state) popup.classList.toggle("show");
console.log('contains:', popup.classList.contains('show'));
//updateMarkers()
//var popup = document.getElementById("myPopup");
//popup.classList.toggle("show");
}
</script>
<br>
<!--
<div style="height:70%;width:70%" id="mapid"></div>
-->
<!--testing-->
<div id='mapid' style='width: 100%; height: 50%;'></div>
<script type="text/javascript" src="myscripts.js"></script>
<!-- Dropdown Checkbox init -->
<script>
document.multiselect('#categorySelect')
.setCheckBoxClick("checkboxAll", function(target, args) {
console.log("Checkbox 'Select All' was clicked and got value ", args.checked);
})
.setCheckBoxClick("1", function(target, args) {
console.log("Checkbox for item with value '1' was clicked and got value ", args.checked);
});
document.multiselect('#typeSelect')
.setCheckBoxClick("checkboxAll", function(target, args) {
console.log("Checkbox 'Select All' was clicked and got value ", args.checked);
})
.setCheckBoxClick("1", function(target, args) {
console.log("Checkbox for item with value '1' was clicked and got value ", args.checked);
});
document.multiselect('#yearSelect')
.setCheckBoxClick("checkboxAll", function(target, args) {
console.log("Checkbox 'Select All' was clicked and got value ", args.checked);
})
.setCheckBoxClick("1", function(target, args) {
console.log("Checkbox for item with value '1' was clicked and got value ", args.checked);
});
function enable() {
document.multiselect('#testSelect1').setIsEnabled(true);
}
function disable() {
document.multiselect('#testSelect1').setIsEnabled(false);
}
</script>
</body>