Handle GPS metadata in the UI

This commit is contained in:
simon987
2021-06-11 20:41:05 -04:00
parent efa4a06e56
commit 5b8c13fd13
6 changed files with 66 additions and 7 deletions

View File

@@ -235,4 +235,14 @@ function updateColumnStyle() {
}
`
}
}
function dmsToDecimal(dms, ref) {
const tokens = dms.split(",")
const d = Number(tokens[0].trim().split(":")[0]) / Number(tokens[0].trim().split(":")[1])
const m = Number(tokens[1].trim().split(":")[0]) / Number(tokens[1].trim().split(":")[1])
const s = Number(tokens[2].trim().split(":")[0]) / Number(tokens[2].trim().split(":")[1])
return (d + (m / 60) + (s / 3600)) * (ref === "S" || ref === "W" ? -1 : 1)
}