[TASK] Show decimmal instead of degree, minute
This commit is contained in:
parent
d465f75d0b
commit
a617449ba4
@ -3,26 +3,6 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
||||
"use strict";
|
||||
|
||||
function showGeoURI(d) {
|
||||
function showLatitude(d) {
|
||||
var suffix = Math.sign(d) > -1 ? "' N" : "' S";
|
||||
d = Math.abs(d);
|
||||
var a = Math.floor(d);
|
||||
var min = (d * 60) % 60;
|
||||
a = (a < 10 ? "0" : "") + a;
|
||||
|
||||
return a + "° " + min.toFixed(3) + suffix;
|
||||
}
|
||||
|
||||
function showLongitude(d) {
|
||||
var suffix = Math.sign(d) > -1 ? "' E" : "' W";
|
||||
d = Math.abs(d);
|
||||
var a = Math.floor(d);
|
||||
var min = (d * 60) % 60;
|
||||
a = (a < 100 ? "0" + (a < 10 ? "0" : "") : "") + a;
|
||||
|
||||
return a + "° " + min.toFixed(3) + suffix;
|
||||
}
|
||||
|
||||
if (!helper.hasLocation(d)) {
|
||||
return undefined;
|
||||
}
|
||||
@ -31,8 +11,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
||||
var latitude = d.nodeinfo.location.latitude;
|
||||
var longitude = d.nodeinfo.location.longitude;
|
||||
var a = document.createElement("a");
|
||||
a.textContent = showLatitude(latitude) + " " +
|
||||
showLongitude(longitude);
|
||||
a.textContent = latitude + ", " + longitude;
|
||||
|
||||
a.href = "geo:" + latitude + "," + longitude;
|
||||
el.appendChild(a);
|
||||
|
Loading…
Reference in New Issue
Block a user