[TASK] Show decimmal instead of degree, minute

This commit is contained in:
Xaver Maierhofer 2017-01-17 16:35:41 +01:00
parent d465f75d0b
commit a617449ba4
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8

View File

@ -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);