aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader/static
diff options
context:
space:
mode:
authorPjotr Prins2020-07-17 10:20:04 +0100
committerPjotr Prins2020-07-17 10:20:04 +0100
commitb8376a3174835d75cb8235c622ac49585f23e8ee (patch)
treea223c9b7f67dbcd833aed200aace4106c149071b /bh20simplewebuploader/static
parent06e3922a5541641077b18016e272cddc7e50205b (diff)
downloadbh20-seq-resource-b8376a3174835d75cb8235c622ac49585f23e8ee.tar.gz
bh20-seq-resource-b8376a3174835d75cb8235c622ac49585f23e8ee.tar.lz
bh20-seq-resource-b8376a3174835d75cb8235c622ac49585f23e8ee.zip
Map markers; disabled search again
Diffstat (limited to 'bh20simplewebuploader/static')
-rw-r--r--bh20simplewebuploader/static/map.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/bh20simplewebuploader/static/map.js b/bh20simplewebuploader/static/map.js
index 8b8ecba..e877454 100644
--- a/bh20simplewebuploader/static/map.js
+++ b/bh20simplewebuploader/static/map.js
@@ -6,12 +6,11 @@ var map = L.map( 'mapid', {
});
L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> | <a href="http://covid19.genenetwork.org/">COVID-19 PubSeq</a>',
subdomains: ['a','b','c']
}).addTo(map);
-var markers = L.markerClusterGroup().addTo(mapid)
-
+// var markers = L.markerClusterGroup().addTo(mapid)
function drawMap(){
var mymap = map;
@@ -22,6 +21,7 @@ function drawMap(){
return response.json();
})
.then(data => {
+ /*
for (var i=0; i<data.length;i++) {
gps=data[i]["GPS"].split(" ")
var circle = L.circle([gps[1], gps[0]], {
@@ -31,7 +31,8 @@ function drawMap(){
radius: parseInt(data[i]["count"]) //not working for whatever reason
}).addTo(mymap);
}
- // updateMapMarkers(data);
+ */
+ updateMapMarkers(data);
});
document.getElementById("map_view").classList.remove("invisible");
@@ -44,10 +45,6 @@ function drawMap(){
*
*/
function updateMapMarkers(data) {
- // markers.clearLayers(); // remove all markers
- // document.getElementById("results").classList.remove("invisible");
- // document.getElementById("loader").classList.add("invisible");
-
for (let i = 0; i < data.length; i++) {
let {"count": fastaCount, GPS, LocationLabel: label } = data[i];
let coordinates = GPS.split(" ");
@@ -55,14 +52,8 @@ function updateMapMarkers(data) {
let lat, lon;
[lon, lat] = coordinates.map(parseFloat);
let point = L.point()
- let marker = L.marker([lat, lon]);
- marker.bindPopup("<b>" + label + "</b><br/>" + "FastaCount: " +fastaCount);
- // markers.addLayer(marker)
+ L.marker([lat, lon]).addTo(map)
+ .bindPopup("<b>" + label + "</b><br/>" + "FastaCount: " +fastaCount);
}
}
-
- // Reload the map
- // map.invalidateSize();
- // document.getElementById("map_view").classList.add("invisible");
- // document.getElementById("loader").classList.add("invisible");
}