-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
370 lines (348 loc) · 10.7 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
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
<html lang="en">
<head>
<title>Wastewater Funding Needs</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Materialize -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<!-- icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- ArcGIS API for Javascript css + js -->
<link rel="stylesheet" href="https://js.arcgis.com/4.26/esri/themes/light/main.css">
<script src="https://js.arcgis.com/4.26/"></script>
<!-- My CSS -->
<link rel="stylesheet" href="wwdb.css"/>
</head>
<body onresize="mapSize()", onload="mapSize()">
<!-- Title bar -->
<nav class="blue-grey">
<div class="nav-wrapper blue-grey">
<!-- Title bar for desktop; Hidden for mobile and tablet -->
<span class="hide-on-med-and-down"><a class="brand-logo"><b>Hudson River Watershed Wastewater Infrastructure Funding Needs</b></a></span>
<!-- Title bar for mobile and tablet. Hidden for desktop -->
<span class="hide-on-large-only"><a class="brand-logo center sidenav-trigger" data-target="slide-out"><i class="large material-icons">info</i></a></span>
</div>
</nav>
<!-- Sidebar, shows on mobile and tablets -->
<div id="slide-out" class="sidenav">
<p><b>Hudson River Watershed Wastewater Infrastructure Funding Needs</b></p>
<p>
The Clean Water Act set the goal of "swimmable" water for the United States, and provided funding to construct the wastewater infrastructure
needed to achieve it.
Today, fifty years later, much of this infrastructure has aged past its intended lifespan, resulting in sewage pollution that makes rivers and streams unsafe for recreation.
</p>
<p>
To restore water quality and keep pace with climate change, this essential infrastructure needs repair.
This map summarizes wastewater infrastructure investment needs for the Hudson River Watershed, by legislative district and subwatershed.
</p>
<p>
<b>To use this map</b>, choose your layer of interest and use the eye icons in the legend to hide the other layers.
Tap a location on the map to see information for an area.
</p>
<p class="flow-text">
For more information, read this
<a href="https://www.riverkeeper.org/blogs/water-quality-blogs/more-than-2-billion-needed-to-fix-hudson-river-watershed-sewers/">
blog post at Riverkeeper.org</a>.
</p>
<p class="flow-text">
Data analysis and map by <a href="https://itsjenepstein.github.io/">Jen Epstein</a>
</p>
<p class="flow-text">
Data sources:<br>
<a href="https://data.gis.ny.gov/search?q=legislative">Legislative District Boundaries</a><br>
<a href="https://www.usgs.gov/national-hydrography/watershed-boundary-dataset">Watershed Boundaries</a><br>
<a href="https://efc.ny.gov/cw-iup">Project Funding Needs</a>
</p>
<p>
<a class="sidenav-close"><i class="material-icons">exit_to_app</i></a>
</p>
</div>
<div class="wide-container"> <!-- Start of Materialize container -->
<div class="row brown lighten-5"> <!-- Row for the side panel and main map -->
<div id="control-panel" class="col l3 hide-on-med-and-down"> <!-- side panel div visible only on desktop; content moves to sidebar on tablet and mobile -->
<p class="flow-text big">
The Clean Water Act set the goal of "swimmable" water for the United States, and provided funding to construct the wastewater infrastructure
needed to achieve it.
Today, fifty years later, much of this infrastructure has aged past its intended lifespan, resulting in sewage pollution that makes rivers and streams unsafe for recreation.
</p>
<p>
To restore water quality and keep pace with climate change, this essential infrastucture needs repair.
This map summarizes wastewater infrastructure investment needs for the Hudson River Watershed, by legislative district and subwatershed.
</p>
<p class="flow-text">
For more information, read this
<a href="https://www.riverkeeper.org/blogs/water-quality-blogs/more-than-2-billion-needed-to-fix-hudson-river-watershed-sewers/">
blog post at Riverkeeper.org</a>.
</p>
<p class="flow-text">
Data analysis and map by <a href="https://jenniferlepstein.github.io/">Jen Epstein</a>
</p>
<p class="flow-text">
Data sources:<br>
<a href="https://data.gis.ny.gov/search?q=legislative">Legislative District Boundaries</a><br>
<a href="https://www.usgs.gov/national-hydrography/watershed-boundary-dataset">Watershed Boundaries</a><br>
<a href="https://efc.ny.gov/cw-iup">Project Funding Needs</a>
</p>
</div>
<div id="mapView" class="col s12 l9" height="500px">
</div>
</div> <!-- End row for the side panel and main map -->
</div> <!-- End Materialize container -->
<script>
// Function to activate sidebar
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems);
});
// Esri API key
const apiKey = "AAPK29c5ca172b56494abafb5222d94935b1AdTk7oHDpfqvylDsNFxRI2MVOFkbgHLCwf29vWgVRJvw2jluMB2UIaaoF5t4SVnD";
// Function to get available window size and use it to calculate size of map div so that it fills window height
// This is necessary because map div doesn't work with a percentage based height
// Variable wih = window inner height; mapHeight is calculated by subtracting the navbar height (65)
function mapSize() {
const wih = window.innerHeight;
const mapHeight = wih - 65;
document.getElementById("mapView").style.height = mapHeight + 'px';
};
// ArcGIS SDK dependencies and callback functions
require([
"esri/Map",
"esri/views/MapView",
"esri/widgets/LayerList",
"esri/widgets/LayerList/ListItem",
"esri/Basemap",
"esri/widgets/BasemapToggle",
"esri/layers/FeatureLayer",
"esri/PopupTemplate",
"esri/widgets/Expand"
], function(
Map,
MapView,
LayerList,
ListItem,
Basemap,
BasemapToggle,
FeatureLayer,
PopupTemplate,
Expand
) {
// Create the map
const map = new Map({
basemap: "streets-relief-vector"
});
// Add the map to a MapView
const mapView = new MapView({
container: "mapView",
map: map,
center: [-73.753006, 42.649119],
zoom: 7
});
// Add a layer list
const layerList = new LayerList({
view: mapView
});
const layerListExpand = new Expand({
expandIcon: "layers",
view: mapView,
content: layerList
});
mapView.ui.add(layerListExpand, "top-right");
// Add basemap toggle widget
const basemapToggle = new BasemapToggle({
view: mapView,
nextBasemap: "dark-gray-vector"
});
mapView.ui.add(basemapToggle, "bottom-right");
// Define polygon fill color ramp for 5 classes
const less10 = {
type: "simple-fill",
color: [237,248,251,0.9],
style: "solid",
outline: {
width: 0.2,
color: [255,255,255,0.9]
}
};
const upto50 = {
type: "simple-fill",
color: [179,205,227,0.9],
style: "solid",
outline: {
width: 0.2,
color: [255,255,255,0.9]
}
};
const upto100 = {
type: "simple-fill",
color: [140,150,198,0.9],
style: "solid",
outline: {
width: 0.2,
color: [255,255,255,0.9]
}
};
const upto250 = {
type: "simple-fill",
color: [136,86,167,0.9],
style: "solid",
outline: {
width: 0.2,
color: [255,255,255,0.9]
}
};
const more250 = {
type: "simple-fill",
color: [129,15,124,0.9],
style: "solid",
outline: {
width: 0.2,
color: [255,255,255,0.9]
}
};
// Define symbology renderer with 5 classes
const renderer = {
type: "class-breaks",
field: "total_cost",
legendOptions: {
title: "Total project cost"
},
defaultSymbol: {
type: "simple-fill",
color: "black",
style: "backward-diagonal",
outline: {
width: 0.5,
color: [50,50,50,0.2]
}
},
defaultLabel: "no data",
classBreakInfos: [
{
minValue: 0,
maxValue: 9999999,
symbol: less10,
label: "< $10 million"
},
{
minValue: 10000000,
maxValue: 49999999,
symbol: upto50,
label: "$10 - $50 million"
},
{
minValue: 50000000,
maxValue: 99999999,
symbol: upto100,
label: "$50 - $100 million"
},
{
minValue: 100000000,
maxValue: 249999999,
symbol: upto250,
label: "$100 - $250 million"
},
{
minValue: 250000000,
maxValue: 1000000000,
symbol: more250,
label: "> $250 million"
}
]
};
// Define popups
const templateSen = {
title: "Senate District {DISTRICT}",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "num_projec",
label: "Number of Projects",
},
{
fieldName: "total_cost",
label: "Total Estimated Cost (millions)",
format: {
type: "integer",
digitSeparator: true,
places: 0
}
}
]
}
]
};
const templateAsm = {
title: "Assembly District {DISTRICT}",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "num_projec",
label: "Number of Projects",
},
{
fieldName: "total_cost",
label: "Total Estimated Cost (millions)",
format: {
type: "integer",
digitSeparator: true,
places: 0
}
}
]
}
]
};
const templateHUC = {
title: "{Name} Watershed (HUC ID {HUC8})",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "num_projec",
label: "Number of Projects",
},
{
fieldName: "total_cost",
label: "Total Estimated Cost (millions)",
format: {
type: "integer",
digitSeparator: true,
places: 0
}
}
]
}
]
};
// Add feature layers
const huc8 = new FeatureLayer({
url: "https://services5.arcgis.com/DB7NKEqvyKCtN8m6/arcgis/rest/services/hrw_hu8/FeatureServer/0",
renderer: renderer,
title: "Watersheds (HUC8)",
popupTemplate: templateHUC
});
map.layers.add(huc8);
const senate = new FeatureLayer({
url: "https://services5.arcgis.com/DB7NKEqvyKCtN8m6/arcgis/rest/services/nys_senate_districts/FeatureServer/0",
renderer: renderer,
title: "NYS Senate Districts",
popupTemplate: templateSen
});
map.layers.add(senate);
const assembly = new FeatureLayer({
url: "https://services5.arcgis.com/DB7NKEqvyKCtN8m6/arcgis/rest/services/nys_assembly_districts/FeatureServer/0",
renderer: renderer,
title: "NYS Assembly Districts",
popupTemplate: templateAsm
});
map.layers.add(assembly);
});
</script>
</body>
</html>