-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.htm
More file actions
1023 lines (919 loc) · 42.8 KB
/
index.htm
File metadata and controls
1023 lines (919 loc) · 42.8 KB
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
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>DVRPC Corridor Studies Database</title>
<!-- Core CSS -->
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/typeahead.js-bootstrap.css" rel="stylesheet" type="text/css">
<!--https://github.com/jharding/typeahead.js-bootstrap.css-->
<link rel="stylesheet" href="https://unpkg.com/leaflet@0.7/dist/leaflet.css" />
<!-- Custom styles for this template -->
<style>
html,
body,
#map,
#sidebar,
#container {
height: 100%;
margin: 0px;
}
#sidebar {
border-right: 1px solid #ccc;
}
label {
font-weight: normal;
}
.panel-heading a:hover {
text-decoration: none;
}
#loading {
position: absolute;
width: 220px;
height: 19px;
top: 50%;
left: 50%;
margin: -10px 0 0 -110px;
z-index: 20001;
}
.navbar .navbar-brand {
font-weight: bold;
font-size: 22px;
color: white;
white-space: nowrap;
}
.navbar-inverse {
background-color: #0F78AF;
border: none;
}
.typeahead {
background-color: #FFFFFF;
}
.tt-dropdown-menu {
background-color: #FFFFFF;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 4px 4px 4px 4px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
margin-top: 4px;
padding: 4px 0;
width: 100%;
max-height: 300px;
overflow: auto;
}
.tt-suggestion {
font-size: 14px;
line-height: 20px;
padding: 3px 10px;
}
.tt-suggestion.tt-cursor {
background-color: #0097CF;
color: #FFFFFF;
cursor: pointer;
}
.tt-suggestion p {
margin: 0;
}
.tt-suggestion+.tt-suggestion {
border-top: 1px solid #ccc;
}
.typeahead-header {
margin: 0 5px 5px 5px;
padding: 3px 0;
border-bottom: 2px solid #333;
}
.has-feedback .form-control-feedback {
position: absolute;
top: 0;
right: 0;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
}
a.toggle {
position: fixed;
left: 0;
bottom: 0;
display: block;
-webkit-border-radius: 0 !important;
-moz-border-radius: 0 !important;
border-radius: 0 !important;
-webkit-border-top-right-radius: 4px !important;
-moz-border-top-right-radius: 4px !important;
border-top-right-radius: 4px !important;
-webkit-border-bottom-right-radius: 4px !important;
-moz-border-bottom-right-radius: 4px !important;
border-bottom-right-radius: 4px !important;
background-color: #0F78AF;
color: white;
opacity: 0.8;
z-index: 100;
}
a:hover.toggle {
background-color: #0F78AF;
color: white;
opacity: 1;
}
a,
a:hover,
a:focus {
color: #0F78AF;
}
a1,
a1:hover,
a:focus {
color: #0F78AF;
}
.modal-header {
background-color: #0F78AF;
}
.modal-title {
color: white;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: white;
text-shadow: 0px 1px 0px rgb(255, 255, 255);
opacity: 1;
}
.panel-primary>.panel-heading {
background-color: #0F78AF;
color: black;
}
.media {
padding: 0px 10px 0px 10px;
}
h3,
.h3 {
font-size: 16px;
font-weight: bold;
}
.btn-primary {
background-color: #66ABD1;
height: 35px;
}
#toolbar {
background-color: #0F78AF;
border-top: 2px solid white;
}
.media-object {
border: 1px solid #0F78AF;
}
.leaflet-label {
background: rgb(235, 235, 235);
background: rgba(235, 235, 235, 0.81);
background-clip: padding-box;
border-color: #777;
border-color: rgba(0, 0, 0, 0.25);
border-radius: 4px;
border-style: solid;
border-width: 4px;
color: #111;
display: block;
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
font-weight: bold;
padding: 1px 6px;
position: absolute;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
z-index: 6;
}
.leaflet-label:before {
border-right: 6px solid black;
border-right-color: inherit;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
content: "";
position: absolute;
top: 5px;
left: -10px;
}
.input-group-addon {
background-color: #66ABD1;
border: none;
border-radius: 0px;
}
.form-control {
border-radius: 0px;
}
.input-group {
width: 200px;
}
.leaflet-control-view-center {
background-image: url('img/region.png');
width: 35px !important;
height: 35px !important;
background-color: #428bca !important;
}
#header-link {
display: flex;
align-items: center;
color: white;
text-decoration: none;
}
#logo {
max-height: 2em;
padding-right: 0.25em;
margin-right: 0.25em;
/* border-right: 2px solid #f7f7f7; */
}
#header-link-text {
font-size: 18px;
margin: 0px auto;
font-weight: bold;
}
</style>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.2.0/respond.js"></script>
</head>
<body>
<div class="row" id="container">
<div class="col-sm-5 col-lg-5" id="sidebar" style="padding: 10px; overflow: auto;">
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">
<span>
<a id="header-link" href="//www.dvrpc.org/corridors" target="_new">
<img id="logo" src="img/dvrpc_logo.png" alt="DVRPC Logo" />
<p id="header-link-text" >Corridor Studies Database</p>
</a>
</span>
<div class="btn-group" style=" display:inherit; margin-top:10px; ">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="modal" data-target="#aboutModal">
<i class="icon-question-sign" style="color: white"></i> About</a>
</button>
<!--<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="modal" data-target="#contactModal"><i class="icon-envelope" style="color: white"></i> Contact</a></button>-->
<div class="btn-group">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
<i class="icon-globe" style="color: white"></i> Studies
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="#" onclick="$('#PennsylvaniaModal').modal('show'); return false;">Pennsylvania</a>
</li>
<li>
<a href="#" onclick="$('#NJModal').modal('show'); return false;">New Jersey</a>
</li>
<li>
<a href="#" onclick="$('#MCModal').modal('show'); return false;">Generalized Corridor Studies</a>
</li>
</ul>
</div>
<div class="input-group search-container">
<input id="searchbox" type="text" placeholder="Search by study name" class="form-control">
<span id="searchicon" class="fa fa-search form-control-feedback"></span>
</div>
</div>
</div>
<div class="panel-body" style="padding: 15px">
<div class="panel panel-primary">
<div class="panel-heading">
<font color="white">
<b>Corridor Studies by County </b>
</font>
</div>
<div class="row " style="padding: 5px">
<div class="col-md-6" style="padding-bottom: 5px">
<div class="row" style="margin:0px 0px 5px 25px;">
<font color="black" style="padding: 5px" />
<b>Pennsylvania</b>
</font>
</div>
<img src="img/Bucks.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Bucks County</a>
</span>
<br>
<img src="img/Chester.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Chester County</a>
</span>
<br>
<img src="img/Delaware.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Delaware County</a>
</span>
<br>
<img src="img/Montgomery.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Montgomery County</a>
</span>
<br>
<img src="img/Philadelphia.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Philadelphia County </a>
</span>
<br>
<br>
</div>
<div class="col-md-6">
<div class="row" style="margin:0px 0px 5px 25px;">
<font color="black" style="padding: 5px" />
<b>New Jersey</b>
</font>
</div>
<img src="img/Burlington.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:-1px">
<i></i>Burlington County</a>
</span>
<br>
<img src="img/Camden.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Camden County</a>
</span>
<br>
<img src="img/Gloucester.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Gloucester County </a>
</span>
<br>
<img src="img/Mercer.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Mercer County</a>
</span>
<br>
<img src="img/Multi.png" alt="legend item" style="width:20px;height:20px;vertical-align:middle;margin-left:10px;padding:1px;" />
<span style="margin-left:2px">
<i></i>Multi-County </a>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<font color="white">Click map to view information</font>
</div>
<div class="panel-body" style="padding: 20px 0px 0px 0px;">
<div id='infosidebar'></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-7 col-lg-7" id="map">
</div>
</div>
<a href="#" type="button" rel="tooltip" class="toggle btn btn-default" data-toggle="tooltip" data-placement="right" title="Toggle sidebar">
<i class="icon-chevron-left"></i>
</a>
<div class="modal fade" id="aboutModal">
<div class="modal-dialog" style="width:620px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">
Corridor Studies Database
</h4>
</div>
<div class="modal-body">
<ul id="aboutTabs" class="nav nav-tabs">
<li class="active">
<a href="#about" data-toggle="tab">
<i class="icon-road"></i> About</a>
</li>
<li>
<a href="#disclaimer" data-toggle="tab">
<i class="icon-exclamation-sign"></i> Disclaimer</a>
</li>
<li>
<a href="#help" data-toggle="tab">
<i class="icon-question-sign"></i> Help</a>
</li>
</ul>
<div id="aboutTabsContent" class="tab-content" style="padding-top: 10px;">
<div class="tab-pane fade active in" id="about">
<p>
The Office of Mobility Analysis and Design supports the DVRPC Long-Range Plan, Connections 2045, and the Congestion Management Process (CMP). Projects focus on developing solutions that will increase accessibility and mobility, improve safety, and enhance the quality of life along transportation corridors and sub-areas in the region. Mobility Analysis and Design studies provide direction for transportation decisions based on analysis of transportation performance measures, cost evaluations, and public participation. This application highlights the spatial locations of the areas studied over the years.
<br>
<!-- For more information please visit <a href="//www.dvrpc.org/corridors/" target="_blank"> //www.dvrpc.org/corridors</a>-->
</p>
<p>If you have further questions, please contact Sarah Moran,
<a href="mailto:smoran@dvrpc.org">
<i class="glyphicon glyphicon-envelope"></i> smoran@dvrpc.org</a>
</p>
</div>
<div class="tab-pane fade text-danger" id="disclaimer">
<p>This web page is a public resource of general information. The Delaware Valley Regional Commission
(DVRPC) makes no warranty, representation, or guarantee as to the content, sequence, accuracy,
timeliness, or completeness of any of the spatial data or database information provided herein.
DVRPC and partner state, local, and other agencies shall assume no liability for errors,
omissions, or inaccuracies in the information provided regardless of how caused; or any decision
made or action taken or not taken by any person relying on any information or data furnished
within.</p>
</div>
<div class="tab-pane fade" id="help">
<p>
- Click map to view information about corrdior stuides
</p>
<p>
- Double click on a selected corridor to zoom to the extent of that study area
</p>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="PennsylvaniaModal">
<div class="modal-dialog" style="width:700px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Pennsylvania Studies</h4>
</div>
<div class="modal-body">
<ul id="aboutTabs" class="nav nav-tabs">
<li class="active">
<a href="#bucks" data-toggle="tab">
</i> Bucks</a>
</li>
<li>
<a href="#chester" data-toggle="tab">
</i> Chester</a>
</li>
<li>
<a href="#delaware" data-toggle="tab">
</i> Delaware</a>
</li>
<li>
<a href="#montgomery" data-toggle="tab">
</i> Montgomery</a>
</li>
<li>
<a href="#philadelphia" data-toggle="tab">
</i> Philadelphia</a>
</li>
<li>
<a href="#countypa" data-toggle="tab">
</i> Multi-County</a>
</li>
</ul>
<div id="aboutTabsContent" class="tab-content" style="padding-top: 10px;">
<div class="tab-pane fade active in" id="bucks">
<ul>
<ul>
</div>
<div class="tab-pane fade " id="chester">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="delaware">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="montgomery">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="philadelphia">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="countypa">
<ul>
</ul>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="NJModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">New Jersey Studies</h4>
</div>
<div class="modal-body">
<ul id="aboutTabs" class="nav nav-tabs">
<li class="active">
<a href="#burlington" data-toggle="tab">
</i> Burlington</a>
</li>
<li>
<a href="#camden" data-toggle="tab">
</i> Camden</a>
</li>
<li class="">
<a href="#gloucester" data-toggle="tab">
</i> Gloucester</a>
</li>
<li>
<a href="#mercer" data-toggle="tab">
</i> Mercer</a>
</li>
<li>
<a href="#countynj" data-toggle="tab">
</i> Multi-County</a>
</li>
</ul>
<div id="aboutTabsContent" class="tab-content" style="padding-top: 10px;">
<div class="tab-pane fade active in " id="burlington">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="camden">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="gloucester">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="mercer">
<ul>
</ul>
</div>
<div class="tab-pane fade " id="countynj">
<ul>
</ul>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="MCModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Generalized Corridor Studies</h4>
</div>
<div class="modal-body">
<ul>
<li>
<a href="//www.dvrpc.org/products/13021" target="_blank"> Vissim Standards Project - Year II</a>
</li>
<li>
<a href="//www.dvrpc.org/products/12011" target="_blank"> Vissim Standards Project - Year I</a>
</li>
<li>
<a href="//www.dvrpc.org/products/07028" target="_blank"> Corridor Planning Guide: Towards a More Meaningful Integration of Transportation and Land Use</a>
</li>
<li>
<a href="//www.dvrpc.org/products/98011" target="_blank"> Highway and Transit Corridor Planning</a>
</li>
</ul>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!--<script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>-->
<script type="text/javascript" src="js/typeahead.bundle.min.js"></script>
<!--https://github.com/twitter/typeahead.js/-->
<script type="text/javascript" src="js/geojson-utils.js"></script>
<script src="https://unpkg.com/leaflet@0.7/dist/leaflet.js"></script>
<script src="js/leaflet.label.js"></script>
<script src="js/leaflet.viewcenter.js"></script>
<script src="js/leaflet-providers.js"></script>
<script type="text/javascript">
//Extend L.GeoJSON-- add setOptions method
L.GeoJSON = L.GeoJSON.extend({
setOptions: function (opts) {
//save original json data
this._data = this._data || this.toGeoJSON();
//destory layer group
this.clearLayers();
L.setOptions(this, opts);
//recreate layer group
this.addData(this._data);
},
//return polygon layers that contain the given point
identify: function (latlng) {
var geopoint = {
type: 'Point',
coordinates: [latlng.lng, latlng.lat]
},
features = new L.FeatureGroup();
this.eachLayer(function (layer) {
if (gju.pointInPolygon(geopoint, layer.feature.geometry)) {
features.addLayer(layer);
}
});
return features;
}
});
var map;
var corridorSearch = [];
$(document).ready(function () {
$('[rel=tooltip]').tooltip();
if (document.body.clientWidth <= 767) {
$('#sidebar').toggle();
$('a.toggle i').toggleClass('icon-chevron-left icon-chevron-right');
};
});
//OPEN ABOUT DIALOG
$('#aboutModal').modal();
$(window).resize(function () {
$('.tt-dropdown-menu').css('max-height', $('#container').height() - $('.navbar').height() - 20);
});
$('a.toggle').click(function () {
$('a.toggle i').toggleClass('icon-chevron-left icon-chevron-right');
$('#map').toggleClass('col-sm-9 col-lg-9 col-sm-12 col-lg-12');
$('#sidebar').toggle();
map.invalidateSize();
return false;
});
$('input[name="basemapLayers"]').change(function () {
// Remove unchecked layers
$('input:radio[name="basemapLayers"]:not(:checked)').each(function () {
map.removeLayer(window[$(this).attr('id')]);
});
// Add checked layer
$('input:radio[name="basemapLayers"]:checked').each(function () {
map.addLayer(window[$(this).attr('id')]);
});
});
// Basemap Layers
// var mapquestOSM = L.tileLayer.provider('MapBox.crvanpollard.heonp4ob');
var CartoDB_Positron = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
maxZoom: 18, attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>, © <a href="https://carto.com/attribution">CARTO</a>'
});
var Mapbox_Imagery = L.tileLayer(
'https://api.mapbox.com/styles/v1/crvanpollard/cimpi6q3l00geahm71yhzxjek/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiY3J2YW5wb2xsYXJkIiwiYSI6Ii00ZklVS28ifQ.Ht4KwAM3ZUjo1dT2Erskgg', {
tileSize: 512,
zoomOffset: -1,
attribution: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
// Overlay Layers
var Master = L.geoJson(null, {
style: function (feature) {
switch (feature.properties.COUNTY) {
case 'Bucks': return { color: "#c44365", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Chester': return { color: "#3882f9", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Delaware': return { color: "#fc9390", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Montgomery': return { color: "#4E9030", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Philadelphia': return { color: "#FFD612", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Burlington': return { color: "#3B8686", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Camden': return { color: "#843C77", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Gloucester': return { color: "#FAA634", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Mercer': return { color: "#0B486B", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
case 'Multi': return { color: "#B2B2B2", weight: 1, opacity: 1, fillOpacity: .55, clickable: true };
}
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
layer.bindLabel(feature.properties.Label, { className: 'leaflet-label' });
layer.on({
//mouseover: highlightFeature,
//mousedown: resetHighlight,
click: tboro,
dblclick: zoomToFeature
});
// layer.on({click: tboro});
// layer.on({dbclick: zoomtoFeature});
layer.on({ mouseover: hover });
layer.on({ mouseout: resetHighlight });
}
corridorSearch.push({
name: feature.properties.PUB_NAME,
source: "Master",
id: L.stamp(layer),
bounds: layer.getBounds()
});
},
});
//.on({click: tboro});
$.getJSON("https://services1.arcgis.com/LWtWv6q6BJyKidj8/arcgis/rest/services/CorridorStudies/FeatureServer/0/query?where=1%3D1&outFields=*&outSR=4326&f=pgeojson", function (data) {
Master.addData(data);
// create modal window links for each study
data.features.forEach(function (feature) {
var props = feature.properties
if (props.COUNTY === 'Multi' && props.STATE ==='NJ') {
var modal = document.querySelector('#countynj').firstElementChild
var link = document.createElement('li')
link.innerHTML = '<a href=' + props.REPORT + ' target="_blank">' + props.PUB_NAME + '</a>'
modal.appendChild(link)
}
else if (props.COUNTY === 'Multi' && props.STATE === 'PA') {
var modal = document.querySelector('#countypa').firstElementChild
var link = document.createElement('li')
link.innerHTML = '<a href=' + props.REPORT + ' target="_blank">' + props.PUB_NAME + '</a>'
modal.appendChild(link)
}
else {
var modal = document.querySelector('#' + props.COUNTY.toLowerCase()).firstElementChild
var link = document.createElement('li')
link.innerHTML = '<a href=https://www.dvrpc.org/products/' + props.PUB_NUM + ' target="_blank">' + props.PUB_NAME + '</a>'
modal.appendChild(link)
}
})
});
function hover(e) {
var layer = e.target;
var props = layer.feature.properties;
layer.setStyle({
weight: 3,
color: 'red',
opacity: 1
})
if (!L.Browser.ie && !L.Browser.opera) {
layer.bringToFront();
}
}
function resetHighlight(e) {
var layer = e.target;
//return layer to back of map
if (!L.Browser.ie && !L.Browser.opera) {
layer.bringToBack();
}
Master.resetStyle(e.target);
}
function zoomToFeature(e) {
map.fitBounds(e.target.getBounds());
}
function tboro(e) {
// resetHighlight();
$('#infosidebar').html('');
var layers = Master.identify(e.latlng);
layers.eachLayer(createView);
};
function createView(layer) {
var props = layer.feature.properties,
// https://www.dvrpc.org/asp/pubs/201px/09063.png
content = '<div class="media"><a class="pull-left" href="' + props.REPORT + '"target="_blank"><img class="media-object" alt="pub cover" src="https://www.dvrpc.org/asp/pubs/100px/' + props.GIS_ID + '.png" /></a><div class="media-body"><h3 class="media-heading"><a href="' + (props.REPORT) + '" target="_blank">' + (props.PUB_NAME) + '</a></h3>' +
'<table class="table table-striped table-bordered table-condensed">' +
'<tr><th>Pub Number</th><td>' + (props.GIS_ID) + '</tr>' +
'<tr><th>Year</th><td>' + (props.YEAR) + '</td></tr>' +
'<tr><th>County</th><td>' + (props.COUNTY) + '</td></tr>' +
'<tr><th>Report</th><td><a href="' + (props.REPORT) + '" target="_blank" style="color:blue">' + "View abstract..." + '</a></td></tr>' +
'<table></div></div>';
$('#infosidebar').append(content);
}
var DVRPC = L.geoJson(null, {
style: {
color: 'grey',
weight: 4,
fill: false,
opacity: 0.75,
clickable: false
}
});
$.getJSON("https://services1.arcgis.com/LWtWv6q6BJyKidj8/ArcGIS/rest/services/DVRPC_Boundaries/FeatureServer/1/query?where=DVRPC_REG+%3D+%27Yes%27&outFields=*&outSR=4326&f=pgeojson", function (data) {
DVRPC.addData(data);
});
/// map properties
map = L.map("map", {
zoom: 9,
center: new L.LatLng(39.97, -75.16),
layers: [CartoDB_Positron, Master, DVRPC]
});
var baseLayers = {
"Streets": CartoDB_Positron,
"Imagery": Mapbox_Imagery
};
var layerControl = L.control.layers(baseLayers).addTo(map);
var viewCenter = new L.Control.ViewCenter();
map.addControl(viewCenter);
// Hack to preserver layer order in Layer control
// map.removeLayer(Conservation);
var scaleControl = L.control.scale({
position: 'bottomright'
});
// Highlight search box text on click
$("#searchbox").click(function () {
$(this).select();
});
// Typeahead search functionality
$(document).one("ajaxStop", function () {
map.fitBounds(Master.getBounds());
$("#loading").hide();
var corridorsBH = new Bloodhound({
name: "Master",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: corridorSearch,
limit: 10
});
var geonamesBH = new Bloodhound({
name: "GeoNames",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: "https://api.geonames.org/searchJSON?username=bootleaf&featureClass=P&maxRows=5&countryCode=US&name_startsWith=%QUERY",
filter: function (data) {
return $.map(data.geonames, function (result) {
return {
name: result.name + ", " + result.adminCode1,
lat: result.lat,
lng: result.lng,
source: "GeoNames"
};
});
},
ajax: {
beforeSend: function (jqXhr, settings) {
settings.url += "&east=" + map.getBounds().getEast() + "&west=" + map.getBounds().getWest() + "&north=" + map.getBounds().getNorth() + "&south=" + map.getBounds().getSouth();
$("#searchicon").removeClass("fa-search").addClass("fa-refresh fa-spin");
},
complete: function (jqXHR, status) {
$('#searchicon').removeClass("fa-refresh fa-spin").addClass("fa-search");
}
}
},
limit: 4
});
corridorsBH.initialize();
geonamesBH.initialize();
// instantiate the typeahead UI
$("#searchbox").typeahead({
minLength: 2,
highlight: true,
hint: false
}, {
name: "Master",
displayKey: "name",
source: corridorsBH.ttAdapter(),
templates: {
header: "<h4 class='typeahead-header'>Studies</h4>"
}
}
, {
name: "GeoNames",
displayKey: "name",
source: geonamesBH.ttAdapter(),
templates: {
header: "<h4 class='typeahead-header'> GeoNames</h4>"
}
}
).on("typeahead:selected", function (obj, datum) {
if (datum.source === "Master") {
map.fitBounds(datum.bounds);
$('#infosidebar').html('');
createView(map._layers[datum.id]);
}
if (datum.source === "GeoNames") {
map.setView([datum.lat, datum.lng], 14);
}
if ($(".navbar-collapse").height() > 50) {
$(".navbar-collapse").collapse("hide");
}
}).on("typeahead:opened", function () {
$(".navbar-collapse.in").css("max-height", $(document).height() - $(".navbar-header").height());
$(".navbar-collapse.in").css("height", $(document).height() - $(".navbar-header").height());
}).on("typeahead:closed", function () {
$(".navbar-collapse.in").css("max-height", "");
$(".navbar-collapse.in").css("height", "");
});
$(".twitter-typeahead").css("position", "static");
$(".twitter-typeahead").css("display", "block");
});
// Larger screens get scale control and expanded layer control
if (document.body.clientWidth <= 767) {
var isCollapsed = true;
} else {