Skip to content

Commit 8c36e79

Browse files
authored
Merge pull request #376 from BeniRupp/feature/location-section
Add location section that shows active Hackergarten locations
2 parents 3c46098 + 9e4c2d8 commit 8c36e79

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

css/main.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,10 @@ span.reason {
8080
height: 100px;
8181
width: 100px;
8282
}
83+
84+
#map {
85+
height: 350px;
86+
}
87+
#map .location-marker {
88+
font-size: 16px;
89+
}

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<link href="ng-dialog/css/ngDialog.min.css" rel="stylesheet">
2121
<link href="ng-dialog/css/ngDialog-theme-default.min.css" rel="stylesheet">
2222

23+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
24+
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI="
25+
crossorigin=""/>
26+
2327
<link href="css/main.css" rel="stylesheet">
2428

2529
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
@@ -74,6 +78,14 @@
7478
</div>
7579
</div>
7680

81+
<!-- locations -->
82+
<div class="panel panel-default">
83+
<div class="panel-heading">Locations</div>
84+
<div class="panel-body">
85+
<div id="map"></div>
86+
</div>
87+
</div>
88+
7789
<!-- past events -->
7890
<div class="panel panel-default">
7991
<div class="panel-heading">Past Events</div>
@@ -252,12 +264,16 @@ <h4><strong>Hack {{ngDialogData.title}}.</strong></h4>
252264
<script src="https://cdn.jsdelivr.net/bootstrap/3.3.0/js/bootstrap.min.js"></script>
253265
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
254266
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-xss/0.3.3/xss.js"></script>
267+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
268+
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
269+
crossorigin=""></script>
255270

256271
<script src="ng-dialog/js/ngDialog.js"></script>
257272

258273
<script src="scripts/hgMainPage.js"></script>
259274
<script src="scripts/eventlist.js"></script>
260275
<script src="scripts/github.js"></script>
276+
<script src="scripts/locations.js"></script>
261277

262278
<script src="scripts/mastodon.widget.js"></script>
263279
<script>

scripts/locations.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
$(document).ready(function () {
2+
var map = L.map("map");
3+
L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
4+
maxZoom: 19,
5+
attribution:
6+
'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
7+
}).addTo(map);
8+
9+
var markers = locations.map((location) =>
10+
L.marker([location.lat, location.lon]).bindPopup(
11+
'<span class="location-marker">' + location.venue + "</span>"
12+
)
13+
);
14+
markers.forEach((marker) => {
15+
marker.addTo(map);
16+
});
17+
18+
var group = new L.featureGroup(markers);
19+
map.fitBounds(group.getBounds());
20+
});
21+
22+
var locations = [
23+
{
24+
venue: "Quatico Solutions AG",
25+
lat: 47.3925495,
26+
lon: 8.507826793619888,
27+
},
28+
{
29+
venue: "codecentric AG",
30+
lat: 48.72592,
31+
lon: 9.1144,
32+
},
33+
{
34+
venue: "CSS Versicherung",
35+
lat: 47.0435895,
36+
lon: 8.315118,
37+
},
38+
{
39+
venue: "Karakun AG",
40+
lat: 47.5487602,
41+
lon: 7.5879349,
42+
},
43+
];

0 commit comments

Comments
 (0)