summaryrefslogtreecommitdiff
path: root/reports/map.js
blob: bf268d260ccf26472c75793e7d14bdefa0c7b49f (plain)
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
let mymap = L.map('mapid').setView([25, 0], 2);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZmFuc2FsY3kiLCJhIjoiY2pvN3I1czJwMHF5NDNrbWRoMWpteHlrdCJ9.kMpM5syQUhVjKkn1iVx9fg', {
    attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
    maxZoom: 18,
    id: 'mapbox.streets',
    accessToken: 'your.mapbox.access.token'
}).addTo(mymap);
let points;
try {
  points = JSON.parse(document.querySelector('script[type="text/json"]').innerText)
} catch(e) {
  console.log("json error!")
  points = []
}
points.forEach(point => {
  /*
    [
      "Face Alignment by Local Deep Descriptor Regression",
      "Rutgers University",
      [
        "Rutgers University",
        "40.47913175",
        "-74.431688684404",
        "Rutgers Cook Campus - North, Biel Road, New Brunswick, Middlesex County, New Jersey, 08901, USA"
      ]
    ]
  */

  var marker = L.marker(point[2].slice(1,3)).addTo(mymap);
  marker.bindPopup([
    "<b>",point[0], "</b>",
    "<br>",
    point[1],
  ].join(''))
})