From 9a5038f3f43a15204547343573d963ad0d570d98 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Tue, 17 Jan 2017 17:00:03 +0100 Subject: [PATCH] [TASK] Limit shown coordinates to 6 decimals --- lib/infobox/node.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/infobox/node.js b/lib/infobox/node.js index 393cbd4..b214cf1 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -8,12 +8,9 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"] } return function (el) { - var latitude = d.nodeinfo.location.latitude; - var longitude = d.nodeinfo.location.longitude; var a = document.createElement("a"); - a.textContent = latitude + ", " + longitude; - - a.href = "geo:" + latitude + "," + longitude; + a.textContent = Number(d.nodeinfo.location.latitude.toFixed(6)) + ", " + Number(d.nodeinfo.location.longitude.toFixed(6)); + a.href = "geo:" + d.nodeinfo.location.latitude + "," + d.nodeinfo.location.longitude; el.appendChild(a); }; }