From f062b82f4e01523c95d47bc6f4182555e27ed213 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 18 Jun 2020 15:54:40 +0300 Subject: fix: show missing markers The SPARQL query returns "-85.58 44.34" instead of "Point(-85.58 44.34)", so the markers could not be displayed --- bh20simplewebuploader/static/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js index f2e5d99..d9b182e 100644 --- a/bh20simplewebuploader/static/main.js +++ b/bh20simplewebuploader/static/main.js @@ -38,10 +38,10 @@ function fetchAPI(apiEndPoint) { if (!(apiEndPoint === "/api/getAllaccessions")) { for (let i = 0; i < data.length; i++) { let {"Fasta Count": fastaCount, GPS, LocationLabel: label } = data[i]; - let coordinates = GPS.match(/Point\((-?[0-9]+(?:.(?:[0-9]+)?)?) (-?[0-9]+(?:.(?:[0-9]+)?)?)\)/); + let coordinates = GPS.split(" "); if (!(coordinates == null)) { let lat, lon; - [lon, lat] = coordinates.slice(1, 3).map(parseFloat); + [lon, lat] = coordinates.map(parseFloat); let point = L.point() let marker = L.marker([lat, lon]); marker.bindPopup("" + label + "
" + "FastaCount: " +fastaCount); @@ -279,4 +279,4 @@ fetch(scriptRoot + "api/getCountByGPS") } }); -} \ No newline at end of file +} -- cgit v1.2.3