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
#main {
font-family: monospace;
body {
text-align: center;
<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;
<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>
......@@ -9,8 +9,9 @@
projects because they are so simple.
<li><a href="FinalGradeCalculator.html">Final Grade Calculator</a></li>
<li><a href="WhereAmI.html">Where am I?</a></li>
Copyright &copy; 2018 Peter Jin. View this repository on
Copyright &copy; 2018-2019 Peter Jin. View this repository on
<a href="">GitHub</a> and
<a href="">GitLab</a>.
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