From 34b1972124da38f6cd28c1991f190bd4bdf1fe9e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 9 Nov 2018 19:48:43 +0100 Subject: interface with the google sheet --- reports/map.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'reports/map.js') diff --git a/reports/map.js b/reports/map.js index b1b896e7..e6244686 100644 --- a/reports/map.js +++ b/reports/map.js @@ -19,8 +19,7 @@ let points = read_json('citations') let address = read_json('address') let source = [0,0] if (address) { - source[0] = parseFloat(address[1]) - source[1] = parseFloat(address[2]) + source = address.slice(3,5).map(n => parseFloat(n)) console.log(address, source) } points.forEach(point => { @@ -37,7 +36,9 @@ points.forEach(point => { ] */ - const latlng = point[2].slice(1,3) + const latlng = point.slice(5,7).map(n => parseFloat(n)) + console.log(point) + if (!latlng.length || isNaN(latlng[0]) || isNaN(latlng[1])) return var marker = L.marker(latlng).addTo(map); marker.bindPopup([ "",point[0], "", @@ -52,6 +53,7 @@ points.forEach(point => { // vertices: 100, // } // L.Polyline.Arc(source, latlng, arcStyle).addTo(map); + console.log(latlng) var pathStyle = { color: 'rgb(245, 246, 150)', fillColor: 'rgb(245, 246, 150)', -- cgit v1.2.3-70-g09d2