forked from danwsong/hood-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
611 lines (593 loc) · 32.3 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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
<!DOCTYPE html>
<head>
<title>237 Hoods</title>
<script src="geoxml3.js"></script>
<script src="transitions.js"></script>
<script src="http://js.api.here.com/v3/3.0/mapsjs-core.js" type="text/javascript" charset="utf-8"></script>
<script src="http://js.api.here.com/v3/3.0/mapsjs-service.js" type="text/javascript" charset="utf-8"></script>
<script src="main.js"></script>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
</head>
<body>
<h1 id = "mainheader">HOOD237</h1>
<div id = "sidebar">
<div id="pMenuContainer" onclick="togglePMenu()" class = "active">
<p>Personal Profile</p>
</div>
<div id="housingContainer" onclick="toggleHMenu()">
<p>Housing</p>
</div>
<div id="recreationContainer" onclick="toggleRMenu()">
<p>Recreation</p>
</div>
<div id="commercialContainer" onclick="toggleCMenu()">
<p>Commercial</p>
</div>
<div id="foodContainer" onclick="toggleFMenu()">
<p>Food</p>
</div>
<div id="educationContainer" onclick="toggleTMenu()">
<p>Education</p>
</div>
</div>
<div id = "map">
</div>
<div id="tabformatting">
<div id = "personalprofile" class = "active">
<br/>
<div class="dropdown">
<button class="dropbtn">Select Age Range</button>
<div class="dropdown-content">
<a href="#">Under 18</a>
<a href="#">18-30</a>
<a href="#">31-60</a>
<a href="#">Over 60</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Employment Status</button>
<div class="dropdown-content">
<a href="#">Unemployed</a>
<a href="#">Student-Unemployed</a>
<a href="#">In Training</a>
<a href="#">Employed</a>
<a href="#">Student-Employed</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Ethnicity</button>
<div class="dropdown-content">
<a href="#">White</a>
<a href="#">South Asian</a>
<a href="#">East Asian</a>
<a href="#">Arab</a>
<a href="#">Black</a>
</div>
</div>
<br /><br /><br /><br /><br /><br /><br />
<div class="dropdown">
<button class="dropbtn">Gender</button>
<div class="dropdown-content">
<a href="#">Male</a>
<a href="#">Female</a>
<a href="#">Other</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Family Size</button>
<div class="dropdown-content">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3-4</a>
<a href="#">Over 4</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Yearly Income</button>
<div class="dropdown-content">
<a href="#">Under $20000</a>
<a href="#">$20000-$50000</a>
<a href="#">$50000-$80000</a>
<a href="#">$80000-$100000</a>
<a href="#">Over $100000</a>
</div>
</div>
<br /><br /><br /><br /><br /><br /><br />
<p>How long are you willing to walk to a desired destination?</p>
<br /><br />
<form class="buttons">
<label class="container">Less than 5 minutes
<input type="radio" checked="checked" name="radio" onclick="walk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">5-10 minutes
<input type="radio" name="radio" onclick="walk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">10-20 minutes
<input type="radio" name="radio" onclick="walk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">More than 20 minutes
<input type="radio" name="radio" onclick="walk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br /><br /><br /><br />
<p>How long are you willing to bicycle to a desired destination?</p>
<br /><br />
<form class="buttons">
<label class="container">Less than 5 minutes
<input type="radio" checked="checked" name="radio" onclick="bike = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">5-10 minutes
<input type="radio" name="radio" onclick="bike = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">10-20 minutes
<input type="radio" name="radio" onclick="bike = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">More than 20 minutes
<input type="radio" name="radio" onclick="bike = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br /><br /><br /><br />
<p>How long are you willing to bus to a desired destination?</p>
<br /><br />
<form class="buttons">
<label class="container">Less than 5 minutes
<input type="radio" checked="checked" name="radio" onclick="bus = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">5-10 minutes
<input type="radio" name="radio" onclick="bus = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">10-20 minutes
<input type="radio" name="radio" onclick="bus = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">More than 20 minutes
<input type="radio" name="radio" onclick="bus = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br /><br /><br /><br /><br />
</div>
<div id = "housingmenu">
<br />
<p>How much are you willing to pay for a house per month?</p><br /><br /><br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="housePrice" onchange="user.sliderData.housePrice = document.getElementById('housePrice').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br />
<br />
<p>How important is it for you to have a house at this price?</p>
<br /><br /><br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="houseImportance" onchange="user.sliderData.houseImportance = document.getElementById('houseImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
</div>
<div id = "recreationmenu">
<br />
<p>How far would you prefer the nearest recreation center to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="recreationWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="recreationWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="recreationWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="recreationWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a recreation center at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="recImportance" onchange="user.sliderData.recImportance = document.getElementById('recImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br />
<br />
<p>How far would you prefer the nearest park to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="parkWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="parkWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="parkWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="parkWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a park at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="parkImportance" onchange="user.sliderData.parkImportance = document.getElementById('parkImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br />
<br />
<p>How far would you prefer the nearest golf course to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="golfWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="golfWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="golfWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="golfWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a golf course at your preferred amount of distance?</p>
<br /><br /><br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="gcImportance" onchange="user.sliderData.gcImportance = document.getElementById('gcImportance').value; setNeighborhoods();">
</div><br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br /><br /><br /><br />
</div>
<div id = "commercialmenu">
<br />
<p>How far would you prefer the nearest shopping mall or plaza to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="mallWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="mallWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="mallWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="mallWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a shopping mall or plaza at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="comImportance" onchange="user.sliderData.comImportance = document.getElementById('comImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br />
<br />
<p>How far would you prefer the nearest museum or a gallery to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="museumWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="museumWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="museumWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="museumWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a museum or gallery at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="mgImportance" onchange="user.sliderData.mgImportance = document.getElementById('mgImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
</div>
<div id = "foodmenu">
<br />
<p>How far would you prefer the nearest grocery store to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="groceryWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="groceryWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="groceryWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="groceryWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a grocery store at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="groceryImportance" onchange="user.sliderData.groceryImportance = document.getElementById('groceryImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br />
<br />
<p>How far would you prefer the nearest restaurant to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="restWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="restWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="restWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="restWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a restaurant at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="restImportance" onchange="user.sliderData.restImportance = document.getElementById('restImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
</div>
<div id = "educationmenu">
<br />
<p>How far would you prefer a school to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="schoolWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="schoolWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="schoolWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="schoolWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have a school at your preferred amount of distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="schoolImportance" onchange="user.sliderData.schoolImportance = document.getElementById('schoolImportance').value; setNeighborhoods();">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
<br />
<br />
<p>How far would you prefer the nearest library to be?</p>
<br />
<br />
<form class="buttons">
<label class="container">Walking Distance
<input type="radio" checked="checked" name="radio" onclick="libraryWalk = 0; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Biking Distance
<input type="radio" name="radio" onclick="libraryWalk = 1; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Bussing Distance
<input type="radio" name="radio" onclick="libraryWalk = 2; setNeighborhoods();">
<span class="checkmark"></span>
</label>
<label class="container">Does not matter
<input type="radio" name="radio" onclick="libraryWalk = 3; setNeighborhoods();">
<span class="checkmark"></span>
</label>
</form>
<br />
<br />
<br />
<br />
<p>How important is it to have library at your preferred distance?</p>
<br />
<br />
<br />
<div class = "slidecontainer">
<input type="range" min="1" max="5" value="3 " class="slider" id="libImportance">
</div>
<br /><br />
<p style="font-size:12px;margin-left:20px;">Not Very Important
No Preference
Very Important</p>
</div>
</div>
</div>
<script>
var src = "https://opendata.arcgis.com/datasets/f80de78b8abc4d08b3ef46cd4cc7f629_8.kml";
var debug;
var map;
var parser;
var x = new XMLHttpRequest();
x.open("GET", src, true);
x.onreadystatechange = function () {
if (x.readyState == 4 && x.status == 200)
{
doc = x.responseXML;
for (var i = 0; i < doc.getElementsByTagName("LineStyle").length; i++) {
doc.getElementsByTagName("LineStyle")[i].getElementsByTagName("color")[0].childNodes[0].nodeValue = "ff000000";
}
for (var i = 0; i < doc.getElementsByTagName("PolyStyle").length; i++) {
doc.getElementsByTagName("PolyStyle")[i].getElementsByTagName("fill")[0].childNodes[0].nodeValue = "1";
doc.getElementsByTagName("PolyStyle")[i].appendChild(doc.createElement("color"));
doc.getElementsByTagName("PolyStyle")[i].getElementsByTagName("color")[0].appendChild(doc.createTextNode("40ffff00"));
doc.getElementsByTagName("PolyStyle")[i].appendChild(doc.createElement("colorMode"));
doc.getElementsByTagName("PolyStyle")[i].getElementsByTagName("colorMode")[0].appendChild(doc.createTextNode("normal"));
}
processData();
}
};
x.send(null);
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: {
lat: 43.2557,
lng: -79.8711
}
});
parser = new geoXML3.parser({
map: map
});
parser.parseKmlString(new XMLSerializer().serializeToString(doc.documentElement), []);
}
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDBv4uCora2zrezirpkTh7hxr_7JEVfgc0&callback=initMap">
</script>
</body>
</html>