aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2020-07-18 09:51:01 +0100
committerPjotr Prins2020-07-18 09:51:01 +0100
commit70c994b5e549b7fc2e167130c7f3e7b171131000 (patch)
treefa210c1987cb7ca7b2c0b55d4c3459302f36e27c
parentfe8129b37d8b6787920a21f9961316747b62fb30 (diff)
downloadbh20-seq-resource-70c994b5e549b7fc2e167130c7f3e7b171131000.tar.gz
bh20-seq-resource-70c994b5e549b7fc2e167130c7f3e7b171131000.tar.lz
bh20-seq-resource-70c994b5e549b7fc2e167130c7f3e7b171131000.zip
Map: import feature settings
-rw-r--r--bh20simplewebuploader/static/map.js43
1 files changed, 39 insertions, 4 deletions
diff --git a/bh20simplewebuploader/static/map.js b/bh20simplewebuploader/static/map.js
index 1003f7d..8a1d5ac 100644
--- a/bh20simplewebuploader/static/map.js
+++ b/bh20simplewebuploader/static/map.js
@@ -29,11 +29,46 @@ function drawMap(){
-/* This function updates the map with markers
- *
-*/
+
+/*
+ * This function updates the map with markers
+ */
+
function updateMapMarkers(data) {
- let markers = L.markerClusterGroup();
+ let markers = L.markerClusterGroup({
+
+ iconCreateFunction: function (cluster) {
+ var theseMarkers = cluster.getAllChildMarkers(); //// -- this is the array of each marker in the cluster.
+
+ sumCount = 0;
+ for (var i = 0; i < theseMarkers.length; i++) {
+ // sumCount += theseMarkers[i].feature.properties.Confirmed;
+ sumCount += 1;
+ }
+
+ var digits = (sumCount + '').length;
+
+ return L.divIcon({
+ html: sumCount,
+ className: 'cluster digits-' + digits,
+ iconSize: null
+ });
+ },
+
+ 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),
+ fillOpacity: .3,
+ radius: getRad(feature.properties.Confirmed),
+ pane: 'circlesIIOM'
+ });
+
+ },
+
+ });
for (let i = 0; i < data.length; i++) {
let {"count": fastaCount, GPS, LocationLabel: label } = data[i];
let coordinates = GPS.split(" ");