aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-06-18 15:54:40 +0300
committerBonfaceKilz2020-06-18 15:54:40 +0300
commitf062b82f4e01523c95d47bc6f4182555e27ed213 (patch)
treee546cf7fc1ebce3dbc447de8a43677fd77c168e0
parente5daaefe32379a22abfd332ee3ba7c139efb8458 (diff)
downloadbh20-seq-resource-f062b82f4e01523c95d47bc6f4182555e27ed213.tar.gz
bh20-seq-resource-f062b82f4e01523c95d47bc6f4182555e27ed213.tar.lz
bh20-seq-resource-f062b82f4e01523c95d47bc6f4182555e27ed213.zip
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
-rw-r--r--bh20simplewebuploader/static/main.js6
1 files changed, 3 insertions, 3 deletions
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("<b>" + label + "</b><br/>" + "FastaCount: " +fastaCount);
@@ -279,4 +279,4 @@ fetch(scriptRoot + "api/getCountByGPS")
}
});
-} \ No newline at end of file
+}