-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.html
323 lines (285 loc) · 12 KB
/
Map.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
<!DOCTYPE html>
<html>
<head>
<title>Safe Route</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="/leaflet/leaflet.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="/markers/leaflet.awesome-markers.css"></script>
<script src="/leaflet/leaflet.js"></script>
<script src="jquery/jquery.min.js"></script>
<script src="chart.js/chart.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="css/style.css" />
<script src="/leaflet/leaflet.js"></script>
<script src="/jquery/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js"></script>
<script src="/markers/leaflet.awesome-markers.min.js"></script>
<script src="/turf/turf.min.js"></script>
<script src="/private/tokens.js"></script>
<script src="data/desnsityAreas.js"></script>
<script src="/js/createPolygons.js"></script>
<script src="/js/autocomplete.js"></script>
<script src="data/accidents.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="/">Safe Route</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<div class="navbar-nav">
<a class="nav-item nav-link active" href="/">Home <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="/howto">How-To</a>
<a class="nav-item nav-link" href="/imprint">Imprint</a>
</div>
</div>
</nav>
<div id="overlay" class="hideme">
<div class="spinner-border spinner text-primary" role="status" style="height: 10rem;width: 10rem;">
<span class="sr-only">Loading...</span>
</div>
</div>
<div class="row">
<div class="col-xxl-8 col-xl-6 col-md-12">
<div id="map">
<div id="leafletMap"></div>
<div id="route">
<button id="routeButton" class="btn" onclick="toggle_visibility('routeSelection', 'routeButton');"><i
class="fas fa-route"></i></button>
<div id="routeSelection" class="sidebar" style="visibility: visible;">
<div class="sidebar" id="ajaxLoad"></div>
<div class="row">
<div class="col-md-6">
<table>
<tr>
<td><span>Transport:</span></td>
<td>
<input type="radio" class="transport" name="transport" value="driving-car"> Car
<input type="radio" class="transport" name="transport" value="cycling-regular" checked>
Bicycle
<input type="radio" class="transport" name="transport" value="foot-walking"> Pedestrian
<!-- <input type="radio" class="transport" name="transport" value="wheelchair"> Wheelchair -->
</td>
</tr>
<tr>
<td><label for="start">Start:</label></td>
<td><input type="text" class="input form-control autoComplete" id="start" name="Start" style="width: 100%;" placeholder="Street Nr., City, Country"></td>
</tr>
<tr>
<td><label for="finish">Finish:</label></td>
<td><input type="text" class="input form-control autoComplete" id="finish" name="Finish" style="width: 100%;" placeholder="Street Nr., City, Country"></td>
</tr>
<tr>
<td><button id="submit" class="button btn btn-primary">Submit</button></td>
<td><input type="checkbox" name="markers" value="higlight" checked="checked"> Highlight start and finish </td>
</tr>
</table>
</div>
<div class="col-md-6">
Route information:
<div id="info">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xxl-4 col-lg-6">
<ul class="nav nav-tabs">
<li><a class="nav-link hideme" data-toggle="tab" id="none" href="#home">Shortest</a></li>
<li><a class="nav-link active hideme" data-toggle="tab" id="level5" href="#menu1">Avoid high risk</a></li>
<li><a class="nav-link hideme" data-toggle="tab" id="level4" href="#menu2">Avoid medium risk</a></li>
<li><a class="nav-link hideme" data-toggle="tab" id="level3" href="#menu3">Avoid low risk</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<div class="row">
<div class="col-md-6">
<div class="chart-container" style="position: relative; width:90%; height: 90%;">
<canvas id="weekdays0" height = "100%" width="100%"></canvas>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="category0" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="light0" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="type0" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="participants0" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="time0" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
</div>
<div id="menu1" class="tab-pane fade">
<div class="row">
<div class="col-lg-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="weekdays5" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="category5" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="light5" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="type5" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="participants5" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="time5" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
</div>
<div id="menu2" class="tab-pane fade">
<div class="row">
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="weekdays4" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="category4" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="light4" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="type4" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="participants4" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="time4" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
</div>
<div id="menu3" class="tab-pane fade">
<div class="row">
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="weekdays3" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="category3" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="light3" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="type3" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="participants3" height = "50%" width="50%"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="chart-container" style="position: relative; width: 90%; height: 90%;">
<canvas id="time3" height = "50%" width="50%"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
<div class="chart-container" style="position: relative; height:50vh; width:50vw">
<canvas id="participants"></canvas>
<canvas id="time"></canvas>
</div>-->
<script src="js/L.TileLayer.BetterWMS.js"></script>
<script>
var mymap = L.map('leafletMap')
.setView([51.9606649, 7.6261347], 13);
var southWest = L.latLng(51.86758805107504, 7.4562835693359375);
var northEast = L.latLng(52.07233159817613,7.813339233398437);
var mybounds = L.latLngBounds(southWest, northEast);
mymap.setMaxBounds(mybounds)
var osmlayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data: © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',
minZoom:12,
maxZoom: 18
}).addTo(mymap);
var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
minZoom: 12,
maxZoom: 18
});
</script>
<script src="js/routing.js"></script>
<script src="js/accidents.js"></script>
</body>
</html>