Add jitter to imprecise positions
This commit is contained in:
parent
4c745123c1
commit
cbcbeb9a22
1 changed files with 7 additions and 1 deletions
|
|
@ -3354,9 +3354,15 @@
|
||||||
if(nodeHasUplinkedToMqttRecently){
|
if(nodeHasUplinkedToMqttRecently){
|
||||||
icon = iconMqttConnected;
|
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
|
// create node marker
|
||||||
const marker = L.marker([node.latitude, longitude], {
|
const marker = L.marker([node.latitude + jitter, longitude + jitter], {
|
||||||
icon: icon,
|
icon: icon,
|
||||||
tagName: node.node_id,
|
tagName: node.node_id,
|
||||||
// we want to show online nodes above offline, but without needing to use separate layer groups
|
// we want to show online nodes above offline, but without needing to use separate layer groups
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue