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
From a56475f2b869962dcf7bbad276db1553fef203ab Mon Sep 17 00:00:00 2001
From: BonfaceKilz
Date: Thu, 18 Jun 2020 16:00:56 +0300
Subject: fix(map): update fasta count key
---
bh20simplewebuploader/static/main.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'bh20simplewebuploader')
diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js
index d9b182e..a9dfc10 100644
--- a/bh20simplewebuploader/static/main.js
+++ b/bh20simplewebuploader/static/main.js
@@ -32,12 +32,13 @@ function fetchAPI(apiEndPoint) {
return response.json();
})
.then(data => {
+ console.log(data);
markers.clearLayers();
document.getElementById("results").classList.remove("invisible");
document.getElementById("loader").classList.add("invisible");
if (!(apiEndPoint === "/api/getAllaccessions")) {
for (let i = 0; i < data.length; i++) {
- let {"Fasta Count": fastaCount, GPS, LocationLabel: label } = data[i];
+ let {"count": fastaCount, GPS, LocationLabel: label } = data[i];
let coordinates = GPS.split(" ");
if (!(coordinates == null)) {
let lat, lon;
--
cgit v1.2.3