Skip to content

Commit

Permalink
Development
Browse files Browse the repository at this point in the history
  • Loading branch information
phieri committed Oct 9, 2024
1 parent e6ab2b6 commit 5cd48ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
5 changes: 2 additions & 3 deletions _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
<meta name="description" content="Visar koordinaterna för nuvarande position i formatet SWEREF 99 TM.">
</head>
<body>
<h1>Nuvarande SWEREF 99 TM
</h1>
<div id="uncert">&pm;5000&nbsp;m</div>
<h1>Nuvarande SWEREF 99 TM</h1>
<div id="uncert"></div>
<div id="sweref-n">N</div>
<div id="sweref-e">E</div>
<button id="pos-btn">Starta</button>
Expand Down
20 changes: 12 additions & 8 deletions src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ document.addEventListener(
false,
);

const uncert = document.querySelector("#uncert");
const swerefn = document.querySelector("#sweref-n");
const swerefe = document.querySelector("#sweref-e");

document.addEventListener(
"dblclick",
(event) => {
function success(position: any) {
window.alert(position.coords.latitude);
uncert!.textContent = "&pm;" + position.coords.accuracy + "&nbsp;m";
swerefn!.textContent = "N&NBSP;" + position.coords.latitude;
swerefe!.textContent = "E&NBSP;" + position.coords.longitude;
}

function error() {
alert("Sorry, no position available.");
window.alert("Fel: ingen position tillgänglig.");
}

const options = {
enableHighAccuracy: true,
maximumAge: 30000,
Expand All @@ -30,10 +36,8 @@ document.addEventListener(
false,
);

if ("geolocation" in navigator) {
window.alert("Geoloc avai");
} else {
window.alert("No geolo");
if (!("geolocation" in navigator)) {
window.alert("Fel: platstjänsten är inte tillgänglig.");
}

const shareData = {
Expand Down
4 changes: 2 additions & 2 deletions src/sr9.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "src/proj.h"
#include <stdio.h>

int main(void) {
PJ_CONTEXT *C;
PJ *P;
PJ *norm;
PJ_COORD a, b;

C = PJ_DEFAULT_CTX;

P = proj_create_crs_to_crs(
Expand Down

0 comments on commit 5cd48ff

Please sign in to comment.