summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-02-25 17:07:47 +0100
committerJules Laplace <julescarbon@gmail.com>2019-02-25 17:07:47 +0100
commitbc240ba2a4b5e30710d37af88eccd905209fc263 (patch)
tree536281157e7a394edff02343926ae80c0d7daf90 /client
parentcd624bdcc5307713dca541f1be130450e86d62ea (diff)
update final report
Diffstat (limited to 'client')
-rw-r--r--client/map/index.js17
1 files changed, 3 insertions, 14 deletions
diff --git a/client/map/index.js b/client/map/index.js
index e8543c77..b744c8e2 100644
--- a/client/map/index.js
+++ b/client/map/index.js
@@ -1,17 +1,6 @@
import L from 'leaflet'
import './leaflet.bezier'
-function getCitations(dataset) {
- // console.log(dataset.citations)
- return dataset.citations.map(c => ({
- title: c[0],
- location: c[2],
- lat: c[5],
- lng: c[6],
- type: c[7],
- }))
-}
-
const arcStyle = {
color: 'rgb(245, 246, 150)',
fillColor: 'rgb(245, 246, 150)',
@@ -51,7 +40,7 @@ export default function append(el, payload) {
const { data } = payload
let { paper, address } = data
let source = [0, 0]
- const citations = getCitations(data)
+ const data.citations
let map = L.map(el).setView([25, 0], 2)
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
@@ -65,13 +54,13 @@ export default function append(el, payload) {
}).addTo(map)
if (address) {
- source = address.slice(3, 5).map(n => parseFloat(n))
+ source = [address.lat, address.lng]
}
citations.forEach(point => {
const latlng = [point.lat, point.lng]
if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return
- addMarker(map, latlng, point.title, point.location)
+ addMarker(map, latlng, point.title, point.address)
addArc(map, source, latlng)
})