From 9d637c5b585e327bf7b0937af77d6136084abb2a Mon Sep 17 00:00:00 2001 From: tuffnerdstuff Date: Mon, 29 Mar 2021 23:16:40 +0200 Subject: [PATCH] setting accuracy circle also when acc == null --- frontend/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/main.js b/frontend/main.js index 3bbda17..d55b5b0 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -732,8 +732,8 @@ function processUpdate(data, init) { } // Draw an accuracy circle if GPS accuracy was provided by the // client. - if (acc !== null && shares[user].circle == null) { - shares[user].circle = L.circle([lat, lon], {radius: acc, fillColor: iconColor, fillOpacity: 0.25, color: iconColor, opacity: 0.5, interactive: false}).addTo(circleLayer); + if (shares[user].circle == null) { + shares[user].circle = L.circle([lat, lon], {radius: acc != null ? acc : 0, fillColor: iconColor, fillOpacity: 0.25, color: iconColor, opacity: 0.5, interactive: false}).addTo(circleLayer); } else if (shares[user].circle !== null) { shares[user].circle.setLatLng([lat, lon]); if (acc !== null) shares[user].circle.setRadius(acc);