-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
681 lines (656 loc) · 35.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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="css/leaflet.css"><link rel="stylesheet" href="css/L.Control.Locate.min.css">
<link rel="stylesheet" href="css/qgis2web.css">
<link rel="stylesheet" href="css/MarkerCluster.css">
<link rel="stylesheet" href="css/MarkerCluster.Default.css">
<link rel="stylesheet" href="css/leaflet-control-geocoder.Geocoder.css">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/trafforddatalab/[email protected]/leaflet.reachability.min.css"/>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/fontawesome-all.min.css">
<!-- <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
<!--bootstrap cdn files-->
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<style>
html, body, #map {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
.form-card{
border: 2px solid;
padding: 20px;
border-radius: 5px;
margin:10px
}
/* Make the icons larger in the user interface */
.reachability-control-settings-button
{
font-size: 27px;
}
</style>
<title>Web App</title>
<!--manifest json file-->
<link rel="manifest" href="manifest.json">
<!--firebase cdn files-->
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.21.0/firebase-app.js"></script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.21.0/firebase-auth.js"></script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.21.0/firebase-database.js"></script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.21.0/firebase-storage.js"></script>
</head>
<body>
<script src="js/qgis2web_expressions.js"></script>
<script src="js/leaflet.js"></script><script src="js/L.Control.Locate.min.js"></script>
<script src="js/leaflet.rotatedMarker.js"></script>
<script src="js/leaflet.pattern.js"></script>
<script src="js/leaflet-hash.js"></script>
<script src="js/Autolinker.min.js"></script>
<script src="js/rbush.min.js"></script>
<script src="js/labelgun.min.js"></script>
<script src="js/labels.js"></script>
<script src="js/leaflet-control-geocoder.Geocoder.js"></script>
<script src="js/leaflet.markercluster.js"></script>
<script src="data/Police_Stations_1.js"></script>
<script src="data/Fire_Stations_2.js"></script>
<script src="data/Emergencycare_hospitals_3.js"></script>
<script src="data/Bloodbanks_4.js"></script>
<script src="data/Ambulance_Stations_5.js"></script>
<!-- <script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-tAGcCfR4Sc5ZP5ZoVz0quoZDYX5aCtEm/eu1KhSLj2c9eFrylXZknQYmxUssFaVJKvvc0dJQixhGjG2yXWiV9Q==" crossorigin=""></script> -->
<script src="https://cdn.jsdelivr.net/gh/trafforddatalab/[email protected]/leaflet.reachability.min.js"></script>
<!-- Navbar start -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#"><i class="fas fa-street-view"></i> Reachability</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item" id='logoutBtn' style="display: none;">
<a class="nav-link" onclick="logoutUser()">Logout</a>
</li>
</ul>
</div>
</nav>
<!-- Navbar start -->
<div id="not_logged_in">
<!-- Jumbotron start -->
<div class="jumbotron jumbotron">
<div class="container">
<h1 class="display-4">Reachability Web App</h1>
<p class="lead">This is a Web-based application especially developed for the users to find out reachability from the location points of emergency services in the area of interest. Online service used in it to get real-time results on the map for spatial decision support. The application will be very useful for the city planners, civil engineers or any government projects related to location services.</p>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-sm-12 col-md-12" >
<div class="form-card">
<p>This is a Sign In form</p>
<div id="sign_in_alerts"></div>
<form id='sign_in_form'>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="sign_in_email" aria-describedby="emailHelp" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="sign_in_pwd" placeholder="Password">
</div>npm
<button type="submit" class="btn btn-primary">Sign In</button>
</form>
</div>
</div>
<div class="col-lg-6 col-sm-12 col-md-12">
<div class="form-card">
<p>This is a Sign up form</p>
<div id="sign_up_alerts">
</div>
<form id='sign_up_form'>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="sign_up_email" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="sign_up_pwd1" placeholder="Password">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Confirm Password</label>
<input type="password" class="form-control" id="sign_up_pwd2" placeholder="Password">
</div>
<button type="submit" class="btn btn-success">Sign up</button>
</form>
</div>
</div>
</div>
</div>
<!-- Jumbotron end -->
<!--after logged in-->
<div id="logged_in" style="display: none;">
<div id='map' style='width: 100%; height: 93vh;'></div>
</div>
<script>
var map = L.map('map', {
zoomControl:true, maxZoom:28, minZoom:5, center: [13.0827, 80.2707]
})
L.control.scale().addTo(map);
var hash = new L.Hash(map);
map.attributionControl.setPrefix('<a href="https://github.com/tomchadwin/qgis2web" target="_blank">qgis2web</a> · <a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a> · <a href="https://qgis.org">QGIS</a> Cretated by Prachi A.Sarode');
var autolinker = new Autolinker({truncate: {length: 30, location: 'smart'}});
L.control.locate({locateOptions: {maxZoom: 19}}).addTo(map);
var bounds_group = new L.featureGroup([]);
function setBounds() {
if (bounds_group.getLayers().length) {
map.fitBounds(bounds_group.getBounds());
}
}
var baseLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
minZoom: 3,
maxZoom: 19
}).addTo(map);
// map.createPane('pane_OpenStreetMap_0');
// map.getPane('pane_OpenStreetMap_0').style.zIndex = 400;
// var layer_OpenStreetMap_0 = L.tileLayer('http://tile.openstreetmap.org/{z}/{x}/{y}.png', {
// pane: 'pane_OpenStreetMap_0',
// opacity: 1.0,
// attribution: '',
// minZoom: 5,
// maxZoom: 28,
// minNativeZoom: 0,
// maxNativeZoom: 18
// });
// layer_OpenStreetMap_0;
// map.addLayer(layer_OpenStreetMap_0);
function pop_Police_Stations_1(feature, layer) {
var popupContent = '<table>\
<tr>\
<th scope="row">Name</th>\
<td>' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">City</th>\
<td>' + (feature.properties['City'] !== null ? autolinker.link(feature.properties['City'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">State</th>\
<td>' + (feature.properties['State'] !== null ? autolinker.link(feature.properties['State'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Country</th>\
<td>' + (feature.properties['Country'] !== null ? autolinker.link(feature.properties['Country'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Address</th>\
<td>' + (feature.properties['Address'] !== null ? autolinker.link(feature.properties['Address'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Latitude</th>\
<td>' + (feature.properties['Latitude'] !== null ? autolinker.link(feature.properties['Latitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Longitude</th>\
<td>' + (feature.properties['Longitude'] !== null ? autolinker.link(feature.properties['Longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['PopupInfo'] !== null ? autolinker.link(feature.properties['PopupInfo'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Police_Stations_1_0() {
return {
pane: 'pane_Police_Stations_1',
rotationAngle: 0.0,
rotationOrigin: 'center center',
icon: L.icon({
iconUrl: 'markers/police-station.svg',
iconSize: [15.960000000000003, 15.960000000000003]
}),
interactive: true,
}
}
map.createPane('pane_Police_Stations_1');
map.getPane('pane_Police_Stations_1').style.zIndex = 401;
map.getPane('pane_Police_Stations_1').style['mix-blend-mode'] = 'normal';
var layer_Police_Stations_1 = new L.geoJson(json_Police_Stations_1, {
attribution: '',
interactive: true,
dataVar: 'json_Police_Stations_1',
layerName: 'layer_Police_Stations_1',
pane: 'pane_Police_Stations_1',
onEachFeature: pop_Police_Stations_1,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.marker(latlng, style_Police_Stations_1_0(feature));
},
});
var cluster_Police_Stations_1 = new L.MarkerClusterGroup({showCoverageOnHover: false,
spiderfyDistanceMultiplier: 2});
cluster_Police_Stations_1.addLayer(layer_Police_Stations_1);
bounds_group.addLayer(layer_Police_Stations_1);
cluster_Police_Stations_1.addTo(map);
function pop_Fire_Stations_2(feature, layer) {
var popupContent = '<table>\
<tr>\
<th scope="row">Name</th>\
<td>' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">City</th>\
<td>' + (feature.properties['City'] !== null ? autolinker.link(feature.properties['City'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">State</th>\
<td>' + (feature.properties['State'] !== null ? autolinker.link(feature.properties['State'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Countary</th>\
<td>' + (feature.properties['Countary'] !== null ? autolinker.link(feature.properties['Countary'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Address</th>\
<td>' + (feature.properties['Address'] !== null ? autolinker.link(feature.properties['Address'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Latitude</th>\
<td>' + (feature.properties['Latitude'] !== null ? autolinker.link(feature.properties['Latitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Longitude</th>\
<td>' + (feature.properties['Longitude'] !== null ? autolinker.link(feature.properties['Longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['PopupInfo'] !== null ? autolinker.link(feature.properties['PopupInfo'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Fire_Stations_2_0() {
return {
pane: 'pane_Fire_Stations_2',
rotationAngle: 0.0,
rotationOrigin: 'center center',
icon: L.icon({
iconUrl: 'markers/iconfinder_firetruck__truck_rescue_truck_fire_2992198.svg',
iconSize: [15.960000000000006, 15.960000000000006]
}),
interactive: true,
}
}
map.createPane('pane_Fire_Stations_2');
map.getPane('pane_Fire_Stations_2').style.zIndex = 402;
map.getPane('pane_Fire_Stations_2').style['mix-blend-mode'] = 'normal';
var layer_Fire_Stations_2 = new L.geoJson(json_Fire_Stations_2, {
attribution: '',
interactive: true,
dataVar: 'json_Fire_Stations_2',
layerName: 'layer_Fire_Stations_2',
pane: 'pane_Fire_Stations_2',
onEachFeature: pop_Fire_Stations_2,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.marker(latlng, style_Fire_Stations_2_0(feature));
},
});
var cluster_Fire_Stations_2 = new L.MarkerClusterGroup({showCoverageOnHover: false,
spiderfyDistanceMultiplier: 2});
cluster_Fire_Stations_2.addLayer(layer_Fire_Stations_2);
bounds_group.addLayer(layer_Fire_Stations_2);
cluster_Fire_Stations_2.addTo(map);
function pop_Emergencycare_hospitals_3(feature, layer) {
var popupContent = '<table>\
<tr>\
<th scope="row">Name</th>\
<td>' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">City</th>\
<td>' + (feature.properties['City'] !== null ? autolinker.link(feature.properties['City'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">State</th>\
<td>' + (feature.properties['State'] !== null ? autolinker.link(feature.properties['State'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Country</th>\
<td>' + (feature.properties['Country'] !== null ? autolinker.link(feature.properties['Country'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Full_Addre</th>\
<td>' + (feature.properties['Full_Addre'] !== null ? autolinker.link(feature.properties['Full_Addre'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Latitude</th>\
<td>' + (feature.properties['Latitude'] !== null ? autolinker.link(feature.properties['Latitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Longitude</th>\
<td>' + (feature.properties['Longitude'] !== null ? autolinker.link(feature.properties['Longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['PopupInfo'] !== null ? autolinker.link(feature.properties['PopupInfo'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Emergencycare_hospitals_3_0() {
return {
pane: 'pane_Emergencycare_hospitals_3',
rotationAngle: 0.0,
rotationOrigin: 'center center',
icon: L.icon({
iconUrl: 'markers/iconfinder_29-call_hospital_5964835.svg',
iconSize: [15.960000000000006, 15.960000000000006]
}),
interactive: true,
}
}
map.createPane('pane_Emergencycare_hospitals_3');
map.getPane('pane_Emergencycare_hospitals_3').style.zIndex = 403;
map.getPane('pane_Emergencycare_hospitals_3').style['mix-blend-mode'] = 'normal';
var layer_Emergencycare_hospitals_3 = new L.geoJson(json_Emergencycare_hospitals_3, {
attribution: '',
interactive: true,
dataVar: 'json_Emergencycare_hospitals_3',
layerName: 'layer_Emergencycare_hospitals_3',
pane: 'pane_Emergencycare_hospitals_3',
onEachFeature: pop_Emergencycare_hospitals_3,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.marker(latlng, style_Emergencycare_hospitals_3_0(feature));
},
});
bounds_group.addLayer(layer_Emergencycare_hospitals_3);
map.addLayer(layer_Emergencycare_hospitals_3);
function pop_Bloodbanks_4(feature, layer) {
var popupContent = '<table>\
<tr>\
<th scope="row">Name</th>\
<td>' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">City</th>\
<td>' + (feature.properties['City'] !== null ? autolinker.link(feature.properties['City'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">State</th>\
<td>' + (feature.properties['State'] !== null ? autolinker.link(feature.properties['State'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Country</th>\
<td>' + (feature.properties['Country'] !== null ? autolinker.link(feature.properties['Country'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Full_Addre</th>\
<td>' + (feature.properties['Full_Addre'] !== null ? autolinker.link(feature.properties['Full_Addre'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Latitude</th>\
<td>' + (feature.properties['Latitude'] !== null ? autolinker.link(feature.properties['Latitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Longitude</th>\
<td>' + (feature.properties['Longitude'] !== null ? autolinker.link(feature.properties['Longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['PopupInfo'] !== null ? autolinker.link(feature.properties['PopupInfo'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Bloodbanks_4_0() {
return {
pane: 'pane_Bloodbanks_4',
rotationAngle: 0.0,
rotationOrigin: 'center center',
icon: L.icon({
iconUrl: 'markers/blood banks.svg',
iconSize: [15.960000000000006, 15.960000000000006]
}),
interactive: true,
}
}
map.createPane('pane_Bloodbanks_4');
map.getPane('pane_Bloodbanks_4').style.zIndex = 404;
map.getPane('pane_Bloodbanks_4').style['mix-blend-mode'] = 'normal';
var layer_Bloodbanks_4 = new L.geoJson(json_Bloodbanks_4, {
attribution: '',
interactive: true,
dataVar: 'json_Bloodbanks_4',
layerName: 'layer_Bloodbanks_4',
pane: 'pane_Bloodbanks_4',
onEachFeature: pop_Bloodbanks_4,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.marker(latlng, style_Bloodbanks_4_0(feature));
},
});
var cluster_Bloodbanks_4 = new L.MarkerClusterGroup({showCoverageOnHover: false,
spiderfyDistanceMultiplier: 2});
cluster_Bloodbanks_4.addLayer(layer_Bloodbanks_4);
bounds_group.addLayer(layer_Bloodbanks_4);
cluster_Bloodbanks_4.addTo(map);
function pop_Ambulance_Stations_5(feature, layer) {
var popupContent = '<table>\
<tr>\
<th scope="row">Name</th>\
<td>' + (feature.properties['Name'] !== null ? autolinker.link(feature.properties['Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">City</th>\
<td>' + (feature.properties['City'] !== null ? autolinker.link(feature.properties['City'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">State</th>\
<td>' + (feature.properties['State'] !== null ? autolinker.link(feature.properties['State'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Country</th>\
<td>' + (feature.properties['Country'] !== null ? autolinker.link(feature.properties['Country'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Address</th>\
<td>' + (feature.properties['Address'] !== null ? autolinker.link(feature.properties['Address'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Latitude</th>\
<td>' + (feature.properties['Latitude'] !== null ? autolinker.link(feature.properties['Latitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Longitude</th>\
<td>' + (feature.properties['Longitude'] !== null ? autolinker.link(feature.properties['Longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['PopupInfo'] !== null ? autolinker.link(feature.properties['PopupInfo'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Ambulance_Stations_5_0() {
return {
pane: 'pane_Ambulance_Stations_5',
rotationAngle: 0.0,
rotationOrigin: 'center center',
icon: L.icon({
iconUrl: 'markers/iconfinder_22-ambulance_5964831.svg',
iconSize: [15.960000000000006, 15.960000000000006]
}),
interactive: true,
}
}
map.createPane('pane_Ambulance_Stations_5');
map.getPane('pane_Ambulance_Stations_5').style.zIndex = 405;
map.getPane('pane_Ambulance_Stations_5').style['mix-blend-mode'] = 'normal';
var layer_Ambulance_Stations_5 = new L.geoJson(json_Ambulance_Stations_5, {
attribution: '',
interactive: true,
dataVar: 'json_Ambulance_Stations_5',
layerName: 'layer_Ambulance_Stations_5',
pane: 'pane_Ambulance_Stations_5',
onEachFeature: pop_Ambulance_Stations_5,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.marker(latlng, style_Ambulance_Stations_5_0(feature));
},
});
var cluster_Ambulance_Stations_5 = new L.MarkerClusterGroup({showCoverageOnHover: false,
spiderfyDistanceMultiplier: 2});
cluster_Ambulance_Stations_5.addLayer(layer_Ambulance_Stations_5);
bounds_group.addLayer(layer_Ambulance_Stations_5);
cluster_Ambulance_Stations_5.addTo(map);
var osmGeocoder = new L.Control.Geocoder({
collapsed: true,
position: 'topleft',
text: 'Search',
title: 'Testing'
}).addTo(map);
document.getElementsByClassName('leaflet-control-geocoder-icon')[0]
.className += ' fa fa-search';
document.getElementsByClassName('leaflet-control-geocoder-icon')[0]
.title += 'Search for a place';
var baseMaps = {};
L.control.layers(baseMaps,{'<img src="legend/Ambulance_Stations_5.png" /> Ambulance_Stations': cluster_Ambulance_Stations_5,'<img src="legend/Bloodbanks_4.png" /> Bloodbanks': cluster_Bloodbanks_4,'<img src="legend/Emergencycare_hospitals_3.png" /> Emergencycare_hospitals': layer_Emergencycare_hospitals_3,'<img src="legend/Fire_Stations_2.png" /> Fire_Stations': cluster_Fire_Stations_2,'<img src="legend/Police_Stations_1.png" /> Police_Stations': cluster_Police_Stations_1, "OpenStreetMap": baseLayer},{collapsed:true}).addTo(map);
setBounds();
</script>
<script>
// Example function to style the isoline polygons when they are returned from the API call
function styleIsolines(feature) {
// NOTE: You can do some conditional styling by reading the properties of the feature parameter passed to the function
return {
color: '#0073d4',
opacity: 0.5,
fillOpacity: 0.2
};
}
// Example function to style the isoline polygons when the user hovers over them
function highlightIsolines(e) {
// NOTE: as shown in the examples on the Leaflet website, e.target = the layer the user is interacting with
var layer = e.target;
layer.setStyle({
fillColor: '#ffea00',
dashArray: '1,13',
weight: 4,
fillOpacity: '0.5',
opacity: '1'
});
}
// Example function to reset the style of the isoline polygons when the user stops hovering over them
function resetIsolines(e) {
// NOTE: as shown in the examples on the Leaflet website, e.target = the layer the user is interacting with
var layer = e.target;
reachabilityControl.isolinesGroup.resetStyle(layer);
}
// Example function to display information about an isoline in a popup when the user clicks on it
function clickIsolines(e) {
// NOTE: as shown in the examples on the Leaflet website, e.target = the layer the user is interacting with
var layer = e.target;
var props = layer.feature.properties;
var popupContent = 'Mode of travel: ' + props['Travel mode'] + '<br />Range: 0 - ' + props['Range'] + ' ' + props['Range units'] + '<br />Area: ' + props['Area'] + ' ' + props['Area units'] + '<br />Population: ' + props['Population'];
if (props.hasOwnProperty('Reach factor')) popupContent += '<br />Reach factor: ' + props['Reach factor'];
layer.bindPopup(popupContent).openPopup();
}
// Example function to create a custom marker at the origin of the isoline groups
function isolinesOrigin(latLng, travelMode, rangeType) {
return L.circleMarker(latLng, { radius: 4, weight: 2, color: '#0073d4', fillColor: '#fff', fillOpacity: 1 });
}
// Add the reachability plugin
var reachabilityControl = L.control.reachability({
// add settings here
apiKey: '<Put your own key here>', // PLEASE REGISTER WITH OPENROUTESERVICE FOR YOUR OWN KEY!
styleFn: styleIsolines,
mouseOverFn: highlightIsolines,
mouseOutFn: resetIsolines,
clickFn: clickIsolines,
markerFn: isolinesOrigin,
expandButtonContent: '',
expandButtonStyleClass: 'reachability-control-expand-button fa fa-bullseye',
collapseButtonContent: '',
collapseButtonStyleClass: 'reachability-control-collapse-button fa fa-caret-up',
drawButtonContent: '',
drawButtonStyleClass: 'fa fa-pencil',
deleteButtonContent: '',
deleteButtonStyleClass: 'fa fa-trash',
distanceButtonContent: '',
distanceButtonStyleClass: 'fa fa-road',
timeButtonContent: '',
timeButtonStyleClass: 'fa fa-clock-o',
travelModeButton1Content: '',
travelModeButton1StyleClass: 'fa fa-car',
travelModeButton2Content: '',
travelModeButton2StyleClass: 'fa fa-bicycle',
travelModeButton3Content: '',
travelModeButton3StyleClass: 'fa fa-male',
travelModeButton4Content: '',
travelModeButton4StyleClass: 'fa fa-wheelchair-alt'
}).addTo(map);
// Setup error handlers in case there is a problem when calling the API
map.on('reachability:error', function () {
alert('Unfortunately there has been an error calling the API.\nMore details are available in the console.');
});
map.on('reachability:no_data', function () {
alert('Unfortunately no data was received from the API.\n');
});
</script>
<!--firebase initiation-->
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "<Put your own key here>",
authDomain: "findservicearea.firebaseapp.com",
databaseURL: "https://findservicearea.firebaseio.com",
projectId: "findservicearea",
storageBucket: "findservicearea.appspot.com",
messagingSenderId: "248931637313",
appId: "1:248931637313:web:7e10da8385d0dceb940ec0",
measurementId: "G-CVR64Y33KD"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<!-- auth js file -->
<script src="js/auth.js"></script>
<!-- map js file -->
<script src="js/map.js"></script>
<!-- App js file -->
<script src="js/app.js"></script>
<!-- Service worker js file-->
<!-- <script src="sw.js"></script> -->
</body>
</html>