rename connections layer group

This commit is contained in:
liamcottle
2024-03-13 15:33:35 +13:00
parent afd7e035b4
commit b0e53c86bb

View File

@ -267,7 +267,7 @@
// create layer groups // create layer groups
var nodesLayerGroup = new L.LayerGroup(); var nodesLayerGroup = new L.LayerGroup();
var connectionsLayerGroup = new L.LayerGroup(); var neighboursLayerGroup = new L.LayerGroup();
// create icons // create icons
var iconOnline = L.divIcon({ className: 'icon-online'}); var iconOnline = L.divIcon({ className: 'icon-online'});
@ -289,7 +289,7 @@
var overlays = { var overlays = {
"Nodes": nodesLayerGroup, "Nodes": nodesLayerGroup,
"Connections": connectionsLayerGroup, "Neighbours": neighboursLayerGroup,
}; };
// add layers to control ui // add layers to control ui
@ -297,7 +297,7 @@
// add layers to map that should be enabled by default // add layers to map that should be enabled by default
nodesLayerGroup.addTo(map); nodesLayerGroup.addTo(map);
connectionsLayerGroup.addTo(map); neighboursLayerGroup.addTo(map);
legend.addTo(map); legend.addTo(map);
// remove outline when map clicked // remove outline when map clicked
@ -432,8 +432,8 @@
nodesLayerGroup.clearLayers(); nodesLayerGroup.clearLayers();
} }
function clearAllConnections() { function clearAllNeighbours() {
connectionsLayerGroup.clearLayers(); neighboursLayerGroup.clearLayers();
} }
function closeAllPopups() { function closeAllPopups() {
@ -481,7 +481,7 @@
closeAllPopups(); closeAllPopups();
closeAllTooltips(); closeAllTooltips();
clearAllNodes(); clearAllNodes();
clearAllConnections(); clearAllNeighbours();
clearNodeOutline(); clearNodeOutline();
} }
@ -581,7 +581,7 @@
continue; continue;
} }
// add node connections // add node neighbours
const neighbours = node.neighbour_info?.neighbours ?? []; const neighbours = node.neighbour_info?.neighbours ?? [];
console.log(neighbours); console.log(neighbours);
for(const neighbour of neighbours){ for(const neighbour of neighbours){
@ -605,7 +605,7 @@
], { ], {
color: '#2563eb', color: '#2563eb',
opacity: 0.5, opacity: 0.5,
}).addTo(connectionsLayerGroup); }).addTo(neighboursLayerGroup);
const tooltip = `<b>${node.long_name}</b> heard <b>${neighbourNode.long_name}</b>` const tooltip = `<b>${node.long_name}</b> heard <b>${neighbourNode.long_name}</b>`
+ `<br/>SNR: ${neighbour.snr}dB` + `<br/>SNR: ${neighbour.snr}dB`