forked from ReproducibiliTea-org/reproducibiliTea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.html
50 lines (43 loc) · 1.57 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
---
---
<html>
<head>
<title>Journal club overview</title>
<link rel="stylesheet" href="assets/css/jc-overview.css"/>
<script type="text/javascript" src="assets/js/jc-overview.js"></script>
{% assign fields = 'title, host-organisation, contact, address, country, geolocation, host-org-url, osf, zotero, website, twitter, signup, organisers' %}
{% assign requiredFields = 'title, host-organisation, organisers, contact, address, country, geolocation' %}
{% assign fieldList = fields | split: ', ' %}
</head>
<body>
<div id="map" style="height: 100%; width: 100%">
</div>
<script id="mapAPIscript" async defer></script>
<script>
let map;
function initMap() {
map = new google.maps.Map(
document.getElementById('map'),
{
center: {lat: 0, lng: 0},
zoom: 1
}
);
let markers = locations.map(function(location, i) {
return new google.maps.Marker({
position: {lat: location[1], lng: location[2]},
map: map
});
});
}
{% assign geos = site.journal-clubs | where_exp: "item", "item.geolocation" %}
const locations = [
{% for jc in geos %}["{{ jc.title }}", {{ jc.geolocation | join: ", " }}]{% unless forloop.last %},{% endunless %}
{% endfor %}
];
{% assign key = site.APIkeys | where_exp: "k", "k[0] == 'maps'" %}
let key = "{{ key[0][1] }}";
document.getElementById('mapAPIscript').src = `https://maps.googleapis.com/maps/api/js?key=${key}&callback=initMap`;
</script>
</body>
</html>