|
|
@ -184,6 +184,8 @@
|
|
|
|
"<br>Longitude: " + crd.longitude +
|
|
|
|
"<br>Longitude: " + crd.longitude +
|
|
|
|
"<br>Distance to TENT: " + distance(target.longitude, target.latitude, crd.longitude, crd.latitude);
|
|
|
|
"<br>Distance to TENT: " + distance(target.longitude, target.latitude, crd.longitude, crd.latitude);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
locationHandler(pos);
|
|
|
|
|
|
|
|
|
|
|
|
// if we want to clear the watch
|
|
|
|
// if we want to clear the watch
|
|
|
|
// if (target.latitude === crd.latitude && target.longitude === crd.longitude) {
|
|
|
|
// if (target.latitude === crd.latitude && target.longitude === crd.longitude) {
|
|
|
|
// console.log('Congratulations, you reached the target');
|
|
|
|
// console.log('Congratulations, you reached the target');
|
|
|
@ -344,7 +346,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
function init() {
|
|
|
|
startBtn.addEventListener("click", startCompass);
|
|
|
|
startBtn.addEventListener("click", startCompass);
|
|
|
|
navigator.geolocation.getCurrentPosition(locationHandler);
|
|
|
|
// navigator.geolocation.getCurrentPosition(locationHandler);
|
|
|
|
|
|
|
|
|
|
|
|
if (!isIOS) {
|
|
|
|
if (!isIOS) {
|
|
|
|
window.addEventListener("deviceorientationabsolute", handler, true);
|
|
|
|
window.addEventListener("deviceorientationabsolute", handler, true);
|
|
|
|