Commit fd055896 authored by Peter H. Jin's avatar Peter H. Jin
Browse files

Add geolocation app

parent 626b0233
Pipeline #47765572 passed with stage
in 21 seconds
<html>
<head>
<style>
#main {
font-family: monospace;
}
body {
text-align: center;
}
</style>
<title>Where am I? (JS Geolocation API tester)</title>
<script type="text/javascript">
function api_onload() {
navigator.geolocation.watchPosition(function (location) {
var resultText = "Your position:";
resultText += "\nLatitude: " + location.coords.latitude;
resultText += "\nLongitude: " + location.coords.longitude;
resultText += "\nLast updated: " + new Date();
document.getElementById("main").innerText = resultText;
});
}
</script>
</head>
<body onload="api_onload();">
<h1>Where Am I?</h1>
<div id="main">To use this app, please enable geolocation in your web browser<br />
and allow this site to use location services.</div>
<div style="margin-top: 16px;"><a href=".">Back to Home Page</a></div>
</body>
</html>
......@@ -9,8 +9,9 @@
projects because they are so simple.
<ul>
<li><a href="FinalGradeCalculator.html">Final Grade Calculator</a></li>
<li><a href="WhereAmI.html">Where am I?</a></li>
</ul>
Copyright &copy; 2018 Peter Jin. View this repository on
Copyright &copy; 2018-2019 Peter Jin. View this repository on
<a href="https://github.com/PHJArea217/miniwebapps">GitHub</a> and
<a href="https://gitlab.com/PHJArea217/miniwebapps">GitLab</a>.
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment