summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-11-13 03:01:13 +0100
committerJules Laplace <julescarbon@gmail.com>2018-11-13 03:01:13 +0100
commit21ce0374d0737ab76c2fadf25047138e0df84c4e (patch)
tree7f88873ea7118e87a8994bf491d21621037a59fa
parent1b61e44f7fb273a3df6f1bb2a02aa046cfe736e0 (diff)
fullscreen mode
-rw-r--r--reports/map.js10
-rw-r--r--reports/reports.css9
2 files changed, 16 insertions, 3 deletions
diff --git a/reports/map.js b/reports/map.js
index 6a2db154..95a5cf26 100644
--- a/reports/map.js
+++ b/reports/map.js
@@ -7,6 +7,12 @@ function read_json(selector) {
}
}
+let map_mode = false
+if (window.location.hash.indexOf('map') !== -1) {
+ document.body.parentNode.classList.add('map')
+ map_mode = true
+}
+
let map = L.map('mapid').setView([25, 0], 2);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
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>',
@@ -45,7 +51,7 @@ points.forEach(point => {
*/
const latlng = point.slice(5,7).map(n => parseFloat(n))
- console.log(point)
+ // console.log(point)
if (!latlng.length || isNaN(latlng[0]) || isNaN(latlng[1])) return
var marker = L.marker(latlng, { icon: redDot }).addTo(map);
marker.bindPopup([
@@ -61,7 +67,7 @@ points.forEach(point => {
// vertices: 100,
// }
// L.Polyline.Arc(source, latlng, arcStyle).addTo(map);
- console.log(latlng)
+ // console.log(latlng)
var pathStyle = {
color: 'rgb(245, 246, 150)',
fillColor: 'rgb(245, 246, 150)',
diff --git a/reports/reports.css b/reports/reports.css
index 1fb2afaf..d5a9755d 100644
--- a/reports/reports.css
+++ b/reports/reports.css
@@ -8,4 +8,11 @@ td {
width: 100vw;
height: 30vw;
}
-.gray { color: #888; } \ No newline at end of file
+.gray { color: #888; }
+html.map, html.map body {
+ margin: 0; padding: 0;
+ width: 100%; height: 100%;
+}
+.map #mapid {
+ height: 100vh;
+} \ No newline at end of file