From dc6a8b4ad5e29f8aea2de73646aeca6e819db0b0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 4 Mar 2019 16:18:54 +0100 Subject: rebuild --- client/map/index.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'client/map/index.js') diff --git a/client/map/index.js b/client/map/index.js index 56a5abed..4b922ec5 100644 --- a/client/map/index.js +++ b/client/map/index.js @@ -76,17 +76,19 @@ export default function append(el, payload) { if (address) { source = [address.lat, address.lng].map(n => parseFloat(n)) + } else { + console.error("No address found for root paper") + console.log(data) } - // ....i dont think the sort order does anything?? - citations.sort((a, b) => sortOrder.indexOf(a) - sortOrder.indexOf(b)) - .forEach(citation => { - const citationAddress = citation.addresses[0] - const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n)) - if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return - addMarker(map, latlng, citation.title, citationAddress.name) - addArc(map, source, latlng, arcStyles[citationAddress.type]) - }) + citations.forEach(citation => { + // console.log(citation) + const citationAddress = citation.addresses[0] + const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n)) + if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return + addMarker(map, latlng, citation.title, citationAddress.name) + addArc(map, source, latlng, arcStyles[citationAddress.type]) + }) console.log(paper) -- cgit v1.2.3-70-g09d2