diff --git a/koki/koryo.js b/koki/koryo.js index 1db85e4..ca166ba 100644 --- a/koki/koryo.js +++ b/koki/koryo.js @@ -20,18 +20,17 @@ let marker = []; let group = []; let judge = []; - - function getCSV(){ - var req = new XMLHttpRequest(); - req.open("get", "latlng.csv", true); - req.send(null); - - req.onload = function(){ - convertCSVtoArray(req.responseText); - } + var csvfile = "latlng.csv"; + var point = []; + function init(){ + fetch(csvfile). + then((resp) =>{ + if (resp.op) return resp.text(); + }).then((txt)=>{ + point = new CSV(txt, {header:true}).parse(); + });; } function convertCSVtoArray(str) { - var point = []; var tmp = str.split("\n"); for(var x=1;x