-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
605 lines (598 loc) · 29.9 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
<!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/fontawesome-all.min.css">
<link rel="stylesheet" href="css/leaflet-control-geocoder.Geocoder.css">
<link rel="stylesheet" href="css/leaflet-measure.css">
<style>
#map {
width: 1518px;
height: 898px;
}
</style>
<title>Downtown Study Spots close to Libraries</title>
</head>
<body>
<div id="map">
</div>
<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-measure.js"></script>
<script src="data/City_Boundary_1.js"></script>
<script src="data/RedeemerUniversityCampus_2.js"></script>
<script src="data/RedemerCampusStudySpots_3.js"></script>
<script src="data/DowntownStudySpots_4.js"></script>
<script src="data/PublicLibrariesinHamilton_5.js"></script>
<script src="data/Cafeswithin500mofaPublicLibrary_6.js"></script>
<script>
var highlightLayer;
function highlightFeature(e) {
highlightLayer = e.target;
if (e.target.feature.geometry.type === 'LineString') {
highlightLayer.setStyle({
color: '#ffff00',
});
} else {
highlightLayer.setStyle({
fillColor: '#ffff00',
fillOpacity: 1
});
}
highlightLayer.openPopup();
}
var map = L.map('map', {
zoomControl:true, maxZoom:28, minZoom:1
}).fitBounds([[43.17927527801089,-79.97345595083145],[43.34382077544984,-79.69505084578965]]);
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>');
var autolinker = new Autolinker({truncate: {length: 30, location: 'smart'}});
L.control.locate({locateOptions: {maxZoom: 19}}).addTo(map);
var measureControl = new L.Control.Measure({
position: 'topleft',
primaryLengthUnit: 'meters',
secondaryLengthUnit: 'kilometers',
primaryAreaUnit: 'sqmeters',
secondaryAreaUnit: 'hectares'
});
measureControl.addTo(map);
document.getElementsByClassName('leaflet-control-measure-toggle')[0]
.innerHTML = '';
document.getElementsByClassName('leaflet-control-measure-toggle')[0]
.className += ' fas fa-ruler';
var bounds_group = new L.featureGroup([]);
function setBounds() {
}
map.createPane('pane_OSMStandard_0');
map.getPane('pane_OSMStandard_0').style.zIndex = 400;
var layer_OSMStandard_0 = L.tileLayer('http://tile.openstreetmap.org/{z}/{x}/{y}.png', {
pane: 'pane_OSMStandard_0',
opacity: 1.0,
attribution: '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap contributors, CC-BY-SA</a>',
minZoom: 1,
maxZoom: 28,
minNativeZoom: 0,
maxNativeZoom: 19
});
layer_OSMStandard_0;
map.addLayer(layer_OSMStandard_0);
function pop_City_Boundary_1(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function(feature){
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2"><strong>OBJECTID</strong><br />' + (feature.properties['OBJECTID'] !== null ? autolinker.link(feature.properties['OBJECTID'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">AREA_IN_HA</th>\
<td>' + (feature.properties['AREA_IN_HA'] !== null ? autolinker.link(feature.properties['AREA_IN_HA'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Shape__Are</th>\
<td>' + (feature.properties['Shape__Are'] !== null ? autolinker.link(feature.properties['Shape__Are'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['Shape__Len'] !== null ? autolinker.link(feature.properties['Shape__Len'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_City_Boundary_1_0() {
return {
pane: 'pane_City_Boundary_1',
opacity: 1,
color: 'rgba(247,247,247,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1.0,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(150,150,150,1.0)',
interactive: true,
}
}
map.createPane('pane_City_Boundary_1');
map.getPane('pane_City_Boundary_1').style.zIndex = 401;
map.getPane('pane_City_Boundary_1').style['mix-blend-mode'] = 'normal';
var layer_City_Boundary_1 = new L.geoJson(json_City_Boundary_1, {
attribution: '',
interactive: true,
dataVar: 'json_City_Boundary_1',
layerName: 'layer_City_Boundary_1',
pane: 'pane_City_Boundary_1',
onEachFeature: pop_City_Boundary_1,
style: style_City_Boundary_1_0,
});
bounds_group.addLayer(layer_City_Boundary_1);
function pop_RedeemerUniversityCampus_2(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function(feature){
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2"><strong>id</strong><br />' + (feature.properties['id'] !== null ? autolinker.link(feature.properties['id'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_RedeemerUniversityCampus_2_0() {
return {
pane: 'pane_RedeemerUniversityCampus_2',
opacity: 1,
color: 'rgba(228,26,28,1.0)',
dashArray: '',
lineCap: 'square',
lineJoin: 'bevel',
weight: 4.0,
fillOpacity: 0,
interactive: false,
}
}
map.createPane('pane_RedeemerUniversityCampus_2');
map.getPane('pane_RedeemerUniversityCampus_2').style.zIndex = 402;
map.getPane('pane_RedeemerUniversityCampus_2').style['mix-blend-mode'] = 'normal';
var layer_RedeemerUniversityCampus_2 = new L.geoJson(json_RedeemerUniversityCampus_2, {
attribution: '',
interactive: false,
dataVar: 'json_RedeemerUniversityCampus_2',
layerName: 'layer_RedeemerUniversityCampus_2',
pane: 'pane_RedeemerUniversityCampus_2',
onEachFeature: pop_RedeemerUniversityCampus_2,
style: style_RedeemerUniversityCampus_2_0,
});
bounds_group.addLayer(layer_RedeemerUniversityCampus_2);
map.addLayer(layer_RedeemerUniversityCampus_2);
function pop_RedemerCampusStudySpots_3(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function(feature){
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2"><strong>1. Name</strong><br />' + (feature.properties['1. Name'] !== null ? autolinker.link(feature.properties['1. Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['lattitude'] !== null ? autolinker.link(feature.properties['lattitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['longitude'] !== null ? autolinker.link(feature.properties['longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">seating options</th>\
<td>' + (feature.properties['seating options'] !== null ? autolinker.link(feature.properties['seating options'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">seats available</th>\
<td>' + (feature.properties['seats available'] !== null ? autolinker.link(feature.properties['seats available'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Noise Level</th>\
<td>' + (feature.properties['Noise Level'] !== null ? autolinker.link(feature.properties['Noise Level'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_RedemerCampusStudySpots_3_0() {
return {
pane: 'pane_RedemerCampusStudySpots_3',
radius: 4.0,
opacity: 1,
color: 'rgba(35,35,35,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(255,166,1,1.0)',
interactive: true,
}
}
map.createPane('pane_RedemerCampusStudySpots_3');
map.getPane('pane_RedemerCampusStudySpots_3').style.zIndex = 403;
map.getPane('pane_RedemerCampusStudySpots_3').style['mix-blend-mode'] = 'normal';
var layer_RedemerCampusStudySpots_3 = new L.geoJson(json_RedemerCampusStudySpots_3, {
attribution: '',
interactive: true,
dataVar: 'json_RedemerCampusStudySpots_3',
layerName: 'layer_RedemerCampusStudySpots_3',
pane: 'pane_RedemerCampusStudySpots_3',
onEachFeature: pop_RedemerCampusStudySpots_3,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.circleMarker(latlng, style_RedemerCampusStudySpots_3_0(feature));
},
});
bounds_group.addLayer(layer_RedemerCampusStudySpots_3);
map.addLayer(layer_RedemerCampusStudySpots_3);
function pop_DowntownStudySpots_4(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function(feature){
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2"><strong>1. Name</strong><br />' + (feature.properties['1. Name'] !== null ? autolinker.link(feature.properties['1. Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['lattitude'] !== null ? autolinker.link(feature.properties['lattitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['longitude'] !== null ? autolinker.link(feature.properties['longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Local or not</th>\
<td>' + (feature.properties['Local or not'] !== null ? autolinker.link(feature.properties['Local or not'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Parking</th>\
<td>' + (feature.properties['Parking'] !== null ? autolinker.link(feature.properties['Parking'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">offers free wifi</th>\
<td>' + (feature.properties['offers free wifi'] !== null ? autolinker.link(feature.properties['offers free wifi'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">bike rack</th>\
<td>' + (feature.properties['bike rack'] !== null ? autolinker.link(feature.properties['bike rack'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['person'] !== null ? autolinker.link(feature.properties['person'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['Accessibility Score'] !== null ? autolinker.link(feature.properties['Accessibility Score'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_DowntownStudySpots_4_0() {
return {
pane: 'pane_DowntownStudySpots_4',
radius: 4.0,
opacity: 1,
color: 'rgba(35,35,35,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(0,254,246,1.0)',
interactive: true,
}
}
map.createPane('pane_DowntownStudySpots_4');
map.getPane('pane_DowntownStudySpots_4').style.zIndex = 404;
map.getPane('pane_DowntownStudySpots_4').style['mix-blend-mode'] = 'normal';
var layer_DowntownStudySpots_4 = new L.geoJson(json_DowntownStudySpots_4, {
attribution: '',
interactive: true,
dataVar: 'json_DowntownStudySpots_4',
layerName: 'layer_DowntownStudySpots_4',
pane: 'pane_DowntownStudySpots_4',
onEachFeature: pop_DowntownStudySpots_4,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.circleMarker(latlng, style_DowntownStudySpots_4_0(feature));
},
});
bounds_group.addLayer(layer_DowntownStudySpots_4);
map.addLayer(layer_DowntownStudySpots_4);
function pop_PublicLibrariesinHamilton_5(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function(feature){
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2"><strong>OBJECTID</strong><br />' + (feature.properties['OBJECTID'] !== null ? autolinker.link(feature.properties['OBJECTID'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2"><strong>NAME</strong><br />' + (feature.properties['NAME'] !== null ? autolinker.link(feature.properties['NAME'].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">COMMUNITY</th>\
<td>' + (feature.properties['COMMUNITY'] !== null ? autolinker.link(feature.properties['COMMUNITY'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">BUILDING_S</th>\
<td>' + (feature.properties['BUILDING_S'] !== null ? autolinker.link(feature.properties['BUILDING_S'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">HOLDINGS</th>\
<td>' + (feature.properties['HOLDINGS'] !== null ? autolinker.link(feature.properties['HOLDINGS'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">CIRCULATIO</th>\
<td>' + (feature.properties['CIRCULATIO'] !== null ? autolinker.link(feature.properties['CIRCULATIO'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">RANKING</th>\
<td>' + (feature.properties['RANKING'] !== null ? autolinker.link(feature.properties['RANKING'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">RADIUS_KM</th>\
<td>' + (feature.properties['RADIUS_KM'] !== null ? autolinker.link(feature.properties['RADIUS_KM'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_PublicLibrariesinHamilton_5_0() {
return {
pane: 'pane_PublicLibrariesinHamilton_5',
radius: 4.0,
opacity: 1,
color: 'rgba(35,35,35,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(255,1,208,1.0)',
interactive: true,
}
}
map.createPane('pane_PublicLibrariesinHamilton_5');
map.getPane('pane_PublicLibrariesinHamilton_5').style.zIndex = 405;
map.getPane('pane_PublicLibrariesinHamilton_5').style['mix-blend-mode'] = 'normal';
var layer_PublicLibrariesinHamilton_5 = new L.geoJson(json_PublicLibrariesinHamilton_5, {
attribution: '',
interactive: true,
dataVar: 'json_PublicLibrariesinHamilton_5',
layerName: 'layer_PublicLibrariesinHamilton_5',
pane: 'pane_PublicLibrariesinHamilton_5',
onEachFeature: pop_PublicLibrariesinHamilton_5,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.circleMarker(latlng, style_PublicLibrariesinHamilton_5_0(feature));
},
});
bounds_group.addLayer(layer_PublicLibrariesinHamilton_5);
map.addLayer(layer_PublicLibrariesinHamilton_5);
function pop_Cafeswithin500mofaPublicLibrary_6(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function(feature){
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2"><strong>1. Name</strong><br />' + (feature.properties['1. Name'] !== null ? autolinker.link(feature.properties['1. Name'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['lattitude'] !== null ? autolinker.link(feature.properties['lattitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['longitude'] !== null ? autolinker.link(feature.properties['longitude'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Local or n</th>\
<td>' + (feature.properties['Local or n'] !== null ? autolinker.link(feature.properties['Local or n'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">Parking</th>\
<td>' + (feature.properties['Parking'] !== null ? autolinker.link(feature.properties['Parking'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">offers fre</th>\
<td>' + (feature.properties['offers fre'] !== null ? autolinker.link(feature.properties['offers fre'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<th scope="row">bike rack</th>\
<td>' + (feature.properties['bike rack'] !== null ? autolinker.link(feature.properties['bike rack'].toLocaleString()) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['person'] !== null ? autolinker.link(feature.properties['person'].toLocaleString()) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Cafeswithin500mofaPublicLibrary_6_0() {
return {
pane: 'pane_Cafeswithin500mofaPublicLibrary_6',
radius: 6.0,
opacity: 1,
color: 'rgba(128,17,25,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 2.0,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(43,219,30,1.0)',
interactive: true,
}
}
map.createPane('pane_Cafeswithin500mofaPublicLibrary_6');
map.getPane('pane_Cafeswithin500mofaPublicLibrary_6').style.zIndex = 406;
map.getPane('pane_Cafeswithin500mofaPublicLibrary_6').style['mix-blend-mode'] = 'normal';
var layer_Cafeswithin500mofaPublicLibrary_6 = new L.geoJson(json_Cafeswithin500mofaPublicLibrary_6, {
attribution: '',
interactive: true,
dataVar: 'json_Cafeswithin500mofaPublicLibrary_6',
layerName: 'layer_Cafeswithin500mofaPublicLibrary_6',
pane: 'pane_Cafeswithin500mofaPublicLibrary_6',
onEachFeature: pop_Cafeswithin500mofaPublicLibrary_6,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.circleMarker(latlng, style_Cafeswithin500mofaPublicLibrary_6_0(feature));
},
});
bounds_group.addLayer(layer_Cafeswithin500mofaPublicLibrary_6);
map.addLayer(layer_Cafeswithin500mofaPublicLibrary_6);
var title = new L.Control();
title.onAdd = function (map) {
this._div = L.DomUtil.create('div', 'info');
this.update();
return this._div;
};
title.update = function () {
this._div.innerHTML = '<h2>Downtown Study Spots close to Libraries</h2>';
};
title.addTo(map);
var abstract = new L.Control({'position':'topright'});
abstract.onAdd = function (map) {
this._div = L.DomUtil.create('div',
'leaflet-control abstract');
this._div.id = 'abstract'
this._div.setAttribute("onmouseenter", "abstract.show()");
this._div.setAttribute("onmouseleave", "abstract.hide()");
this.hide();
return this._div;
};
abstract.hide = function () {
this._div.classList.remove("abstractUncollapsed");
this._div.classList.add("abstract");
this._div.innerHTML = 'i'
}
abstract.show = function () {
this._div.classList.remove("abstract");
this._div.classList.add("abstractUncollapsed");
this._div.innerHTML = 'This map shows students which cafes in downtown Hamilton are within 500 meters from a public library. We made this map in the case that a student needs a library resource while they are studying downtown. To walk 500 meters is less than a 20 minute walk--a reasonable distance for an average student to walk.<br /><br />The Redeemer University campus has been included as a reference to show the distance between campus and the downtown study spots. Additional library and cafe locations are also avialble on this map.';
};
abstract.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/Cafeswithin500mofaPublicLibrary_6.png" /> Cafes within 500m of a Public Library': layer_Cafeswithin500mofaPublicLibrary_6,'<img src="legend/PublicLibrariesinHamilton_5.png" /> Public Libraries in Hamilton': layer_PublicLibrariesinHamilton_5,'<img src="legend/DowntownStudySpots_4.png" /> Downtown Study Spots': layer_DowntownStudySpots_4,'<img src="legend/RedemerCampusStudySpots_3.png" /> Redemer Campus Study Spots': layer_RedemerCampusStudySpots_3,'<img src="legend/RedeemerUniversityCampus_2.png" /> Redeemer University Campus': layer_RedeemerUniversityCampus_2,'<img src="legend/City_Boundary_1.png" /> City_Boundary': layer_City_Boundary_1,"OSM Standard": layer_OSMStandard_0,}).addTo(map);
setBounds();
resetLabels([layer_City_Boundary_1]);
map.on("zoomend", function(){
resetLabels([layer_City_Boundary_1]);
});
map.on("layeradd", function(){
resetLabels([layer_City_Boundary_1]);
});
map.on("layerremove", function(){
resetLabels([layer_City_Boundary_1]);
});
</script>
</body>
</html>