SDE-Interaktivt-kort/Locationtest.php

54 lines
1.6 KiB
PHP

<!DOCTYPE html>
<html lang="dk">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- FONT -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/index.css?v=2">
<link rel="icon" type="image/svg" href="../images/SdeHandLogo.svg"/>
<title>Syddansk Erhvervsskole Map | Test Location</title>
</head>
<script src="../js/ElementControl.js"></script>
<script>
function success(position) {
document.getElementById('output').innerHTML = "Din Position. Latitude: " + position.coords.latitude +
" Longitude: " + position.coords.longitude + " Accuracy= " + position.coords.accuracy;
}
function error() {
alert('Sorry, no position available.');
}
const options = {
enableHighAccuracy: true,
maximumAge: 30000,
timeout: 27000
};
setInterval(function(){
const watchID = navigator.geolocation.watchPosition(success, error, options);
}, 1000);
</script>
<body>
<div style="width: 80%; height: 80%; left: 10%; top: 20px; position:absolute; background-color: #00788A; border-radius: 2vh; ">
<h1 id="output" style="color: white; text-align: center; position: relative; top: 10%; font-family: 'Titillium Web';"></h1>
</div>
<button style="position: absolute; top: 85%" onclick="ChangePage('../index.html');" class="button">Tilbage</button>
</body>
</html>