diff options
Diffstat (limited to 'bh20simplewebuploader')
-rw-r--r-- | bh20simplewebuploader/static/map.js | 23 | ||||
-rw-r--r-- | bh20simplewebuploader/templates/demo.html | 13 | ||||
-rw-r--r-- | bh20simplewebuploader/templates/search.html | 10 |
3 files changed, 19 insertions, 27 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: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>', + attribution: '© <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"); } diff --git a/bh20simplewebuploader/templates/demo.html b/bh20simplewebuploader/templates/demo.html index 65ba462..04bf877 100644 --- a/bh20simplewebuploader/templates/demo.html +++ b/bh20simplewebuploader/templates/demo.html @@ -5,10 +5,21 @@ <body> {% include 'banner.html' %} {% include 'menu.html' %} - {% include 'search.html' %} <p>The Virtuoso database contains <span id="CounterDB"></span> public sequences!</p> + <!-- + <div class="search"> + <input id="search-input" type="search" placeholder="FASTA uri" required> + <button class="button search-button" type="submit" onclick="search()"> + <span class="icon ion-search"> + <span class="sr-only">Search</span> + </span> + </button> + <span class="dropt" title="http://collections.lugli.arvadosapi.com/c=00fede2c6f52b053a14edca01cfa02b7+126/sequence.fasta">(example)<span style="width:500px;"></span></span> + </div> + --> + <section class="search-section"> <div class="filter-options" action="#"> <p>[Demo] Display content sequences by: </p> diff --git a/bh20simplewebuploader/templates/search.html b/bh20simplewebuploader/templates/search.html index dbdca90..e69de29 100644 --- a/bh20simplewebuploader/templates/search.html +++ b/bh20simplewebuploader/templates/search.html @@ -1,10 +0,0 @@ -<div class="search"> - <input id="search-input" type="search" placeholder="FASTA uri" required> - <button class="button search-button" type="submit" onclick="search()"> - <span class="icon ion-search"> - <span class="sr-only">Search</span> - </span> - </button> - <span class="dropt" title="http://collections.lugli.arvadosapi.com/c=00fede2c6f52b053a14edca01cfa02b7+126/sequence.fasta">(example)<span style="width:500px;"></span></span> -</div> - |