-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
248 lines (238 loc) · 8.92 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
<html>
<head>
<title>OTTrees</title>
<meta name="ttw" content="8bwgdwr; charset=utf-8" />
<link rel="stylesheet" href="css/style.css" type="text/css">
<script type="text/javascript" src="javascript/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="javascript/data_load.js"></script>
<script type="text/javascript">
function toggle(type) {
if ($('#' + type).is(':checked')) {
toggleDataOn(type);
} else {
toggleDataOff(type);
}
}
function toggleOriginList(listName) {
if (listName == 'nativeList') {
toggleArray(nonNativeArray, 'off');
toggleArray(nativeArray, 'on');
} else if (listName == 'nonNativeList') {
toggleArray(nativeArray, 'off');
toggleArray(nonNativeArray, 'on');
}
}
function togglePersistenceList(listName) {
if (listName == 'coniferousList') {
toggleArray(marcescentArray, 'off');
toggleArray(deciduousArray, 'off');
toggleArray(coniferousArray, 'on');
} else if (listName == 'marcescentList') {
toggleArray(coniferousArray, 'off');
toggleArray(deciduousArray, 'off');
toggleArray(marcescentArray, 'on');
} else if (listName == 'deciduousList') {
toggleArray(coniferousArray, 'off');
toggleArray(marcescentArray, 'off');
toggleArray(deciduousArray, 'on');
}
}
function toggleNourishmentList(listName) {
if (listName == 'foodBearingList') {
toggleArray(nonFoodBearingArray, 'off');
toggleArray(foodBearingArray, 'on');
} else if (listName == 'nonFoodBearingList') {
toggleArray(foodBearingArray, 'off');
toggleArray(nonFoodBearingArray, 'on');
}
}
function toggleAllergenList(listName) {
if (listName == 'mildAllergenList') {
toggleArray(severeAllergenArray, 'off');
toggleArray(moderateAllergenArray, 'off');
toggleArray(mildAllergenArray, 'on');
} else if (listName == 'moderateAllergenList') {
toggleArray(mildAllergenArray, 'off');
toggleArray(severeAllergenArray, 'off');
toggleArray(moderateAllergenArray, 'on');
} else if (listName == 'severeAllergenList') {
toggleArray(mildAllergenArray, 'off');
toggleArray(moderateAllergenArray, 'off');
toggleArray(severeAllergenArray, 'on');
}
}
function resetForm() {
document.getElementById("treeLists").reset();
for (treeLayer in treeLayerArray) {
toggleDataOff(treeLayer);
}
resetAge();
getSeason();
}
var _gaq = _gaq || [];
_gaq.push([ '_setAccount', 'UA-40391491-1' ]);
_gaq.push([ '_trackPageview' ]);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl'
: 'http://www')
+ '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body onload="initialize()">
<div class="main_content">
<div class="map_canvas_container" id="map_canvas"></div>
</div>
<div id="sidebar_menu">
<form name="treeLists" id="treeLists" method="POST">
<img src="images/OTTrees_logo.png" alt="OTTrees" height="98"
width="200">
<div class="submenublock" id="about">
<h5>About</h5>
<div class="second_level">
<p>
This application was made using the city of Ottawa's <a
href="http://ottawa.ca/en/open-data-ottawa">open data</a> tree
inventory to show unique information about the trees owned and
cared for by the city.
</p>
<p>The trees displayed show foliage based on the season, the
location, and the estimated span of branches over the houses and
buildings of the city. The size of the tree on the map is a
combination of the growth factor, the diameter at breast height,
and estimated age of the tree.</p>
<p>
Please be patient! The data and calculations can take some time to
load. Source code is available on <a
href="http://www.github.com/emdaniels/ottrees">Github</a>.
</p>
<p>
If you are curious, we've posted the making of OTTrees <a
href="http://www.emilydaniels.com/2013/04/the-making-of-ottrees/">here</a>.
We've also mapped a bike route to the oldest trees on Google Maps:
<a
href="https://maps.google.com/maps/ms?msid=207547909246875332554.0004db82e2dc101c79649&msa=0">Ottawa
Ancient Tree Route</a>
</p>
</div>
<p>
<input type="button" onclick="resetForm()" value="clear"
style="float: right;" />
</p>
</div>
<div class="submenublock" id="allergen">
<h5>Allergen Potential</h5>
<ul class="second_level">
<li><input type="radio" name="allergen" id="mildAllergenList"
onclick="toggleAllergenList('mildAllergenList')" /> Mild</li>
<li><input type="radio" name="allergen"
id="moderateAllergenList"
onclick="toggleAllergenList('moderateAllergenList')" /> Moderate</li>
<li><input type="radio" name="allergen"
id="severeAllergenList"
onclick="toggleAllergenList('severeAllergenList')" /> Severe</li>
</ul>
</div>
<div class="submenublock" id="foliage">
<h5>Seasonal Foliage</h5>
<ul class="second_level">
<li><input type="radio" name="seasonalFoliage"
id="earlySpringList" onclick="changeSeason(1);" /> Early Spring</li>
<li><input type="radio" name="seasonalFoliage"
id="lateSpringList" onclick="changeSeason(2);" /> Late Spring</li>
<li><input type="radio" name="seasonalFoliage" id="summerList"
onclick="changeSeason(3);" /> Summer</li>
<li><input type="radio" name="seasonalFoliage"
id="earlyFallList" onclick="changeSeason(4);" /> Early Fall</li>
<li><input type="radio" name="seasonalFoliage"
id="lateFallList" onclick="changeSeason(5);" /> Late Fall</li>
<li><input type="radio" name="seasonalFoliage" id="winterList"
onclick="changeSeason(6);" /> Winter</li>
</ul>
</div>
<div class="submenublock" id="nourishment">
<h5>Nourishment</h5>
<ul class="second_level">
<li><input type="radio" name="foodbearing"
id="foodBearingList"
onclick="toggleNourishmentList('foodBearingList')" /> Food
Bearing</li>
<li><input type="radio" name="foodbearing"
id="nonFoodBearingList"
onclick="toggleNourishmentList('nonFoodBearingList')" /> Non-Food
Bearing</li>
</ul>
</div>
<div class="submenublock" id="origin">
<h5>Origin</h5>
<ul class="second_level">
<li><input type="radio" name="origin" id="nativeList"
onclick="toggleOriginList('nativeList')" /> Native</li>
<li><input type="radio" name="origin" id="nonNativeList"
onclick="toggleOriginList('nonNativeList')" /> Non-Native</li>
</ul>
</div>
<div class="submenublock" id="leafPersistence">
<h5>Leaf Persistence</h5>
<ul class="second_level">
<li><input type="radio" name="leafPersistence"
id="coniferousList"
onclick="togglePersistenceList('coniferousList')" /> Coniferous</li>
<li><input type="radio" name="leafPersistence"
id="marcescentList"
onclick="togglePersistenceList('marcescentList')" /> Marcescent</li>
<li><input type="radio" name="leafPersistence"
id="deciduousList"
onclick="togglePersistenceList('deciduousList')" /> Deciduous</li>
</ul>
</div>
<div class="submenublock" id="age">
<h5>Estimated Age</h5>
<ul class="second_level">
<li><input type="checkbox" name="age0019" onclick="setAge(0)"
checked="checked" /> 0-19 years</li>
<li><input type="checkbox" name="age2039" onclick="setAge(1)"
checked="checked" /> 20-39 years</li>
<li><input type="checkbox" name="age4059" onclick="setAge(2)"
checked="checked" /> 40-59 years</li>
<li><input type="checkbox" name="age6079" onclick="setAge(3)"
checked="checked" /> 60-79 years</li>
<li><input type="checkbox" name="age8099" onclick="setAge(4)"
checked="checked" /> 80-99 years</li>
<li><input type="checkbox" name="age100199"
onclick="setAge(5)" checked="checked" /> 100-199 years</li>
<li><input type="checkbox" name="age200299"
onclick="setAge(6)" checked="checked" /> 200-299 years</li>
<li><input type="checkbox" name="age300399"
onclick="setAge(7)" checked="checked" /> 300-399 years</li>
<li><input type="checkbox" name="age400499"
onclick="setAge(8)" checked="checked" /> 400-499 years</li>
<li><input type="checkbox" name="age500up" onclick="setAge(9)"
checked="checked" /> 500+ years</li>
</ul>
</div>
<div class="submenublock" id="indvidualspecies">
<h5>Individual Species</h5>
<ul class="second_level" id="treeList"></ul>
</div>
</form>
</div>
<script type="text/javascript">
//array for individual speices
var items = [];
$.each(nameArray.sort(), function(i, item) {
items.push('<li><input type="checkbox" id="' + item
+ '" onclick="toggle(\'' + item + '\');" /> '
+ item.replace("_", ", ").replace("_", " ") + '</li>');
});
$('#treeList').append(items.join(''));
</script>
</body>
</html>