Add jitter to imprecise positions

This commit is contained in:
Anton Roslund 2025-07-23 08:07:33 +02:00
parent 4c745123c1
commit cbcbeb9a22

View file

@ -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