From 93b7276b9e80ca549f60ef991678d6021c095335 Mon Sep 17 00:00:00 2001 From: Pablo Revilla Date: Wed, 27 Aug 2025 11:25:26 -0700 Subject: [PATCH] Added the traceroute and neighbours to the map --- meshview/static/live-map.html | 2 +- meshview/templates/map.html | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/meshview/static/live-map.html b/meshview/static/live-map.html index 1d20217..4678649 100644 --- a/meshview/static/live-map.html +++ b/meshview/static/live-map.html @@ -192,7 +192,7 @@ async function pollPackets() { console.error(err); } } - +1 loadNodes().then(()=>{ setInterval(pollPackets,1000); }); diff --git a/meshview/templates/map.html b/meshview/templates/map.html index 9132f7d..e351b0a 100644 --- a/meshview/templates/map.html +++ b/meshview/templates/map.html @@ -124,8 +124,14 @@ if (node.last_update) popupContent += `Last seen: ${timeAgo(node.last_update)}
`; if (node.firmware) popupContent += `Firmware: ${node.firmware}
`; - var marker = L.circleMarker([node.lat, node.long], markerOptions).bindPopup(popupContent); - marker.addTo(map); + var marker = L.circleMarker([node.lat, node.long], markerOptions).addTo(map); + marker.on('click', function() { + marker.bindPopup(popupContent).openPopup(); + setTimeout(() => { + marker.closePopup(); + }, 2000); // 2000 ms = 3 seconds + }); + if (!markers[category]) markers[category] = []; markers[category].push({ marker, isRouter });