From cbcbeb9a2218244820db91ec05e166c375a4adad Mon Sep 17 00:00:00 2001 From: Anton Roslund Date: Wed, 23 Jul 2025 08:07:33 +0200 Subject: [PATCH] Add jitter to imprecise positions --- src/public/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/public/index.html b/src/public/index.html index 12517db..8035f90 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -3354,9 +3354,15 @@ if(nodeHasUplinkedToMqttRecently){ icon = iconMqttConnected; } + // To not have overlapping nodes. + // Should probbably check if there is allready an other node in the same position before applying jitter. + var jitter = 0 + if (node.position_precision != 32) { + jitter = 0.0005 * (Math.random() - 0.5); + } // create node marker - const marker = L.marker([node.latitude, longitude], { + const marker = L.marker([node.latitude + jitter, longitude + jitter], { icon: icon, tagName: node.node_id, // we want to show online nodes above offline, but without needing to use separate layer groups