From 466e445a3ca90ad0a32d7d5d90b76619dcd86043 Mon Sep 17 00:00:00 2001 From: TizziGri <133357784+TizziGri@users.noreply.github.com> Date: Fri, 12 May 2023 18:08:12 +0000 Subject: [PATCH] debugging --- prototype-1/main.js | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/prototype-1/main.js b/prototype-1/main.js index 4763a82..d684086 100644 --- a/prototype-1/main.js +++ b/prototype-1/main.js @@ -85,9 +85,30 @@ setTimeout(() => { // Stream big file in worker thread Papa.parse('data/geodaten.csv', { - worker: true, - step: function(results) { - console.log("Row:", results.data); + //worker: true, + download: true, + header: true, + complete: (results) => { + + let geodata = []; + results.data.forEach((bro) => { + // hier werden wir aus dem objekt ein koordinaten paar beziehen + const coordpair = [parseFloat(bro['WGS84-N']), parseFloat(bro['WGS84-E'])]; + // prüfen ob die koordinaten nummerisch sind + if (typeof coordpair[0] !== 'number'){ + return + } + // koordinaten ins array hinzufügen + geodata.push(coordpair); + if (geodata.length < 100) { + L.marker(coordpair).addTo(map); + } + + }); + + //console.log(geodata); + + } });