diff options
author | Pjotr Prins | 2020-07-18 10:18:42 +0100 |
---|---|---|
committer | Pjotr Prins | 2020-07-18 10:18:42 +0100 |
commit | ff8b4b56227c54c19c94c7d9563e010efe7c4299 (patch) | |
tree | e33eb62be17615ccc4905d8791d1bd79541b0ce4 /bh20simplewebuploader/static | |
parent | 70c994b5e549b7fc2e167130c7f3e7b171131000 (diff) | |
download | bh20-seq-resource-ff8b4b56227c54c19c94c7d9563e010efe7c4299.tar.gz bh20-seq-resource-ff8b4b56227c54c19c94c7d9563e010efe7c4299.tar.lz bh20-seq-resource-ff8b4b56227c54c19c94c7d9563e010efe7c4299.zip |
Map: show count sequences
Diffstat (limited to 'bh20simplewebuploader/static')
-rw-r--r-- | bh20simplewebuploader/static/map.js | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/bh20simplewebuploader/static/map.js b/bh20simplewebuploader/static/map.js index 8a1d5ac..81b6246 100644 --- a/bh20simplewebuploader/static/map.js +++ b/bh20simplewebuploader/static/map.js @@ -31,9 +31,18 @@ function drawMap(){ /* - * This function updates the map with markers + * These functions updates the map with markers */ +seqMarker = L.Marker.extend({ + options: { + seqMarkerLocation: "Loc", + contributors: "countContrib", + sequences: "countSeq" + } +}); + + function updateMapMarkers(data) { let markers = L.markerClusterGroup({ @@ -42,8 +51,8 @@ function updateMapMarkers(data) { sumCount = 0; for (var i = 0; i < theseMarkers.length; i++) { - // sumCount += theseMarkers[i].feature.properties.Confirmed; - sumCount += 1; + console.log(theseMarkers[i]); + sumCount += theseMarkers[i].options.sequences; } var digits = (sumCount + '').length; @@ -58,11 +67,11 @@ function updateMapMarkers(data) { pointToLayer: function (feature, latlng) { return L.circleMarker(latlng, { opacity: 1, - color: getSColor(feature.properties.Confirmed), - weight: getSwieght(feature.properties.Confirmed), - fillColor: getColor(feature.properties.Confirmed), + color: getSColor(10), + weight: getSwieght(10), + fillColor: getColor(10), fillOpacity: .3, - radius: getRad(feature.properties.Confirmed), + radius: getRad(10), pane: 'circlesIIOM' }); @@ -71,12 +80,14 @@ function updateMapMarkers(data) { }); for (let i = 0; i < data.length; i++) { let {"count": fastaCount, GPS, LocationLabel: label } = data[i]; + let countSeq = Number(fastaCount); + let coordinates = GPS.split(" "); if (!(coordinates == null)) { let lat, lon; [lon, lat] = coordinates.map(parseFloat); let point = L.point() - marker = (L.marker([lat, lon])); + marker = new seqMarker([lat, lon],markerOptions={title: fastaCount+" sequences",sequences: countSeq}); marker.bindPopup("<b>" + label + "</b><br/>" + "SARS-CoV-2<br/>sequences: " +fastaCount); markers.addLayer(marker); } |