From 21ce0374d0737ab76c2fadf25047138e0df84c4e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 13 Nov 2018 03:01:13 +0100 Subject: fullscreen mode --- reports/map.js | 10 ++++++++-- reports/reports.css | 9 ++++++++- 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 © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', @@ -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 -- cgit v1.2.3-70-g09d2