Add long name to neighbors tooltip.

This commit is contained in:
Jason Michalski
2024-05-20 21:08:55 -07:00
parent af4717a1f4
commit 6afa5af608
2 changed files with 2 additions and 1 deletions

View File

@@ -79,7 +79,7 @@
L.marker(trace[0]).addTo(map);
{% for n in neighbors %}
var m = L.circleMarker({{n.location | tojson}});
m.bindPopup('SNR: {{n.snr}}<br/><a href="/packet_list/{{n.node_id}}">{{n.node_id | node_id_to_hex}}</a>');
m.bindPopup('SNR: {{n.snr}}<br/><a href="/packet_list/{{n.node_id}}">{{n.name}} {{n.node_id | node_id_to_hex}}</a>');
m.addTo(map);
L.polyline([trace[0], {{n.location | tojson}}], {color: 'red'}).addTo(map);
{% endfor %}

View File

@@ -52,6 +52,7 @@ async def build_neighbors(node_id):
for node in [n.result() for n in neighbors]:
if node.last_lat and node.last_long:
results[node.node_id]['name'] = node.long_name
results[node.node_id]['location'] = (node.last_lat * 1e-7, node.last_long * 1e-7)
else:
del results[node.node_id]