diff options
author | Pjotr Prins | 2020-07-17 10:31:34 +0100 |
---|---|---|
committer | Pjotr Prins | 2020-07-17 10:31:34 +0100 |
commit | fdb534f551e11ba5d43bec4aeba2bab4d141700b (patch) | |
tree | 670d9fb127d3303ce1735e0da4c79585bc1c4109 /bh20simplewebuploader/static/map.js | |
parent | b8376a3174835d75cb8235c622ac49585f23e8ee (diff) | |
download | bh20-seq-resource-fdb534f551e11ba5d43bec4aeba2bab4d141700b.tar.gz bh20-seq-resource-fdb534f551e11ba5d43bec4aeba2bab4d141700b.tar.lz bh20-seq-resource-fdb534f551e11ba5d43bec4aeba2bab4d141700b.zip |
Using mapcluster again
Diffstat (limited to 'bh20simplewebuploader/static/map.js')
-rw-r--r-- | bh20simplewebuploader/static/map.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bh20simplewebuploader/static/map.js b/bh20simplewebuploader/static/map.js index e877454..36208b5 100644 --- a/bh20simplewebuploader/static/map.js +++ b/bh20simplewebuploader/static/map.js @@ -10,7 +10,6 @@ L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { subdomains: ['a','b','c'] }).addTo(map); -// var markers = L.markerClusterGroup().addTo(mapid) function drawMap(){ var mymap = map; @@ -45,6 +44,7 @@ function drawMap(){ * */ function updateMapMarkers(data) { + let markers = L.markerClusterGroup(); for (let i = 0; i < data.length; i++) { let {"count": fastaCount, GPS, LocationLabel: label } = data[i]; let coordinates = GPS.split(" "); @@ -52,8 +52,10 @@ function updateMapMarkers(data) { let lat, lon; [lon, lat] = coordinates.map(parseFloat); let point = L.point() - L.marker([lat, lon]).addTo(map) - .bindPopup("<b>" + label + "</b><br/>" + "FastaCount: " +fastaCount); + marker = (L.marker([lat, lon])); + // .bindPopup("<b>" + label + "</b><br/>" + "FastaCount: " +fastaCount)); + markers.addLayer(marker); } } + map.addLayer(markers); } |