From 31fe68129f7c09367ab54fbcf0e8a51d695a0801 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 20 Mar 2015 17:58:20 +0100 Subject: [PATCH] history: show link distance in popup --- history.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/history.js b/history.js index 2e96f62..89ea6c1 100644 --- a/history.js +++ b/history.js @@ -209,6 +209,10 @@ function addLinksToMap(map, graph) { var line = L.polyline(latlngs, opts) + var distance = new Intl.NumberFormat("de-DE", {maximumFractionDigits: 0}).format(latlngs[0].distanceTo(latlngs[1])) + + line.bindPopup(d.source.node.nodeinfo.hostname + " – " + d.target.node.nodeinfo.hostname + "
" + distance + " m") + return line })