From 06e3922a5541641077b18016e272cddc7e50205b Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 17 Jul 2020 09:59:32 +0100 Subject: Map refactoring, now shows on HOME --- bh20simplewebuploader/static/map.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bh20simplewebuploader/static/map.js') diff --git a/bh20simplewebuploader/static/map.js b/bh20simplewebuploader/static/map.js index e1a4289..8b8ecba 100644 --- a/bh20simplewebuploader/static/map.js +++ b/bh20simplewebuploader/static/map.js @@ -31,6 +31,7 @@ function drawMap(){ radius: parseInt(data[i]["count"]) //not working for whatever reason }).addTo(mymap); } + // updateMapMarkers(data); }); document.getElementById("map_view").classList.remove("invisible"); @@ -42,11 +43,11 @@ function drawMap(){ /* This function updates the map with markers * */ -function updateMapMarkers() { +function updateMapMarkers(data) { // markers.clearLayers(); // remove all markers // document.getElementById("results").classList.remove("invisible"); - document.getElementById("loader").classList.add("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(" "); @@ -57,10 +58,11 @@ function updateMapMarkers() { let marker = L.marker([lat, lon]); marker.bindPopup("" + label + "
" + "FastaCount: " +fastaCount); // markers.addLayer(marker) - }} - */ + } + } + // Reload the map - map.invalidateSize(); + // map.invalidateSize(); // document.getElementById("map_view").classList.add("invisible"); // document.getElementById("loader").classList.add("invisible"); } -- cgit v1.2.3