Added the traceroute and neighbours to the map

This commit is contained in:
Pablo Revilla
2025-08-29 09:19:56 -07:00
parent c374167568
commit 396d919df3

View File

@@ -191,6 +191,7 @@ document.querySelectorAll(".filter-checkbox").forEach(input => {
input.addEventListener("change", updateMarkers);
});
// ---- Edges ----
var edgeLayer = L.layerGroup().addTo(map);
var edgesData = null;
@@ -202,6 +203,8 @@ fetch('/api/edges')
.then(data => { edgesData = data.edges; })
.catch(err => console.error(err));
function onNodeClick(node) {
// Toggle off if already selected
if (selectedNodeId != node.id) {
@@ -237,7 +240,7 @@ edgesData.forEach(edge => {
.addTo(edgeLayer)
.bringToFront(); // Force this line to be visible
console.log(`Edge type: ${edge.type} | From: ${fromNode.long_name} (${fromNode.lat},${fromNode.long}) -> To: ${toNode.long_name} (${toNode.lat},${toNode.long})`);
console.log(`Edge type: To: ${toNode.long_name} (${toNode.lat},${toNode.long})`);
});
// Bring all edges to top