-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
231 lines (204 loc) · 8.97 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
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<title>ETA map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src='https://api.mapbox.com/mapbox.js/v2.4.0/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v2.4.0/mapbox.css' rel='stylesheet' />
<script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-zoomslider/v0.7.0/L.Control.Zoomslider.js'></script>
<link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-zoomslider/v0.7.0/L.Control.Zoomslider.css' rel='stylesheet' />
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css' rel='stylesheet' />
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' rel='stylesheet' />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.legend {
height: 50px;
}
.legend label,
.legend span {
display: block;
float: left;
height: 25px;
width: 30%;
text-align: center;
font-size: 9px;
color: #808080;
}
.ui-control {
font: 15px/20px 'Helvetica', sans-serif;
background: #404040;
color: #fff;
position: absolute;
top: 0;
right: 0;
bottom: 0;
z-index: 100;
width: 22%;
padding: 10px;
overflow: scroll;
}
.ui-control label {
text-transform: uppercase;
display: block;
font-weight: bold;
color: rgba(255, 255, 255, 0.5);
margin-bottom: 5px;
}
.ui-control strong {
font-size: 32px;
line-height: 38px;
}
img {
position: absolute;
left: 10px;
bottom: 0;
height: 40px;
}
p {
font-weight: normal;
font: Arial;
color: white;
}
#title {
color: #e7a322;
font-weight: bold;
}
.leaflet-control-zoomslider-knob {
width: 14px;
height: 6px;
}
.leaflet-container .leaflet-control-zoomslider-body {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
</style>
</head>
<body>
<!-- Set the display of this container to none so we can
add it programmatically to `legendControl` -->
<div id='legend' style='display:none;'>
<strong>Equitable Target Area Index</strong>
<nav class='legend clearfix'>
<span style='background:#e7a322;'></span>
<span style='background:#f26d27;'></span>
<span style='background:#b34154;'></span>
<label>Medium </label>
<label>High </label>
<label>Very High</label>
<!-- <small>Source: <a href="#link to source">Name of source</a></small> -->
</div>
<div id='map'></div>
<div id='info' class='ui-control'>
<div id='title'> Click on an Equitable Target Area to learn more</div>
<br>
<p> This tool helps ARC better understand complexities in communities of concern –high percentage of people living in poverty or high minority population – and how to make wise decisions regarding investments. This index is used to measure the impacts of investments and programs contained within The Region's Plan on ETAs. The ETA index is also used as input for project prioritization and evaluation, monitoring resource allocation, and assisting in decision-making.
<br> <a href="https://documents.atlantaregional.com/The-Atlanta-Region-s-Plan/rtp/appendices.pdf" style="color:#e7a322" target='blank'>To learn more please visit Appendix J of the Atlanta Region's Plan</a> </p>
<img class=logo, src="arc_logo196.png" />
</div>
<script>
//load a layer
L.mapbox.accessToken = 'pk.eyJ1IjoiYXRscmVnaW9uYWwiLCJhIjoiQmZ6d2tyMCJ9.oENm3NSf--qHrimdm9Vvdw';
// initialize the map
//var count = document.getElementById('AsianPacif');
var map = L.mapbox.map('map', 'atlregional.nlcec3mc', {
gridControl: false,
scrollWheelZoom: true,
doubleClickZoom: true,
// maxBounds: [
// [34.93548199355903, -80.67260742187499],
// [32.61161640317033, -87.42370605468749]
// ]
})
.setView([33.81908916394128, -84.04403686523438], 9);
// L.control.zoomslider().addTo(map);
//Set click colors
function highlightFeature(e) {
var layer = e.target;
layer.setStyle({
weight: 3,
opacity: 1,
color: '#1abc9c'
});
}
function resetHighlight(e) {
var layer = e.target;
layer.setStyle({
weight: 3,
opacity: 1,
color: ''
});
}
$.getJSON("https://opendata.arcgis.com/datasets/c91e2e5a355a42308ebb9c0abe42e399_145.geojson", function(etaData) {
L.geoJson(etaData, {
style: function(feature) {
var fllColor,
ETA = feature.properties.ETA;
if (ETA == 4) fillColor = "#f5f5f5", fillOpacity = ".1";
else if (ETA == 3) fillColor = "#e8a40f", fillOpacity = ".9";
else if (ETA == 2) fillColor = "#e76221", fillOpacity = ".9";
else if (ETA == 1) fillColor = "#a43e4c", fillOpacity = ".9";
else fillColor = "#f7f7f7", fillOpacity = ".0"; // no data
return {
color: "",
weight: 1,
fillColor: fillColor,
fillOpacity: fillOpacity
};
},
onEachFeature: function(feature, layer) {
layer.on({
click: function populate() {
document.getElementById('info').innerHTML = "<h3 style='color:#e8a40f'>About this Equitable Target Area </h3>" + '<br>' + "Census Tract Numer: " + feature.properties.NAME + '<br>' + "Population: " + feature.properties.Population + '<br>' + "Asian Pacific Residents: " + feature.properties.AsianPacif + "%" + '<br>' + "African American Residents: " + feature.properties.Black + "%" + '<br>' + "Hispanic Residents: " + feature.properties.Hispanic + "%" + '<br>' + "Other Race Residents: " + feature.properties.Other_Race + "%" + '<br>' + "Residents over the age of 65: " + feature.properties.AgeOvr65 + "%" + '<br>' + "Residents living in poverty: " + feature.properties.Poverty + "%" + '<br>' + '<br>' + '<br>' + '<br>' + "<img src='arc_logo196.png' />";
},
mouseout: function reset() {
document.getElementById('info').innerHTML = "<h3 style='color:#e7a322'> Click on an Equitable Target Area to learn more </h3>" + "This tool helps ARC better understand complexities in communities of concern –high percentage of people living in poverty or high minority population – and how to make wise decisions regarding investments. This index is used to measure the impacts of investments and programs contained within The Region's Plan on ETAs. The ETA index is also used as input for project prioritization and evaluation, monitoring resource allocation, and assisting in decision-making." + '<br>' + '<br>' + "<a href='https://documents.atlantaregional.com/The-Atlanta-Region-s-Plan/rtp/appendices.pdf' style='color:#e7a322' target='blank'>To learn more please visit Appendix J of the Atlanta Region's Plan </a>" + '<br>' + "<img src='arc_logo196.png' />";
}
});
layer.on({
click: highlightFeature,
mouseout: resetHighlight
});
}
}).addTo(map);
});
$.getJSON("https://opendata.arcgis.com/datasets/7b752dcfca54486c8290b399340a407c_17.geojson", function(data) {
transitLayer = data;
var transitIcon = L.icon({
iconUrl: 'transit.png',
iconSize: [17, 22]
});
var transitIcon2 = L.icon({
iconUrl: 'transit.png',
iconSize: [15, 20],
});
L.geoJson(data, {
pointToLayer: function(feature, latlng) {
var marker = L.marker(latlng, {
icon: transitIcon
});
marker.bindPopup('<strong> MARTA Station: </strong>' + feature.properties.Stn_Code + '<br/>' + feature.properties.STATION);
return marker;
}
}).addTo(map);
});
map.legendControl
.addLegend(document.getElementById('legend').innerHTML)
.setPosition('bottomleft');
</script>
</body>
</html>
</body>
</html>