Skip to content

Commit 115f51a

Browse files
committed
accmod for testing
1 parent bdbf48c commit 115f51a

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

index.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ <h2>Your accuracy is too low to confirm that you are in the correct area.</h2>
197197
<div class='tab'>
198198
<h1>Tutorial</h1>
199199
<h2>How to use the orienteering application?</h2>
200-
<p>If you have done orienteering before this application implements all parts of orienteering except the compass. When you open <b class="blue hover" onclick="tab(2);">Maps (Start)</b> there will be maps listed below the legend. If you click on one of the courses, it then opens so that you can then print the map and start the course. Alternatively while on the course you can press the "Options" button and "View Map" to see the map. <br><br>When you have arrived at your first destination (the start) click confirm, to confirm you are in the right location. Continue this process to the end of the course.<br><br> While on the course check the bottom of the screen where it shows your accuracy, if the accuracy is too high (above 15 m) then wait until it stablizes and try again. <br><br>If accuracy is still too high it may be a problem with the device, connection, or internet browser. If you do not see the accuracy bubble at the bottom of the screen make sure location services are turned on for both your phone and the website page. </p>
200+
<p>If you have done orienteering before this application implements all parts of orienteering except the compass. When you open <b class="blue hover" onclick="tab(2);">Maps (Start)</b> there will be maps listed below the legend. If you click on one of the courses, it then opens so that you can then print the map and start the course. Alternatively while on the course you can press the "Options" button and "View Map" to see the map. <br><br>When you have arrived at your first destination (the start) click confirm, to confirm you are in the right location. Continue this process to the end of the course.<br><br> While on the course check the bottom of the screen where it shows your <span onclick="tab(18);">accuracy</span>, if the accuracy is too high (above 15 m) then wait until it stablizes and try again. <br><br>If accuracy is still too high it may be a problem with the device, connection, or internet browser. If you do not see the accuracy bubble at the bottom of the screen make sure location services are turned on for both your phone and the website page. </p>
201201
<div class='button mainPageAlt' onclick='tab(1);'>Back</div>
202202
</div>
203203
<!-- 13 -->
@@ -241,6 +241,12 @@ <h1>Name</h1>
241241
<input id="name" type="text" placeholder="Type your name here..." maxlength="15" autocomplete="off" />
242242
<div class='button mainPageBtn' onclick='setName();'>Submit</div>
243243
</div>
244+
<!-- 18 -->
245+
<div class='tab'>
246+
<h1>Accuracy Modifier</h1>
247+
<input id="accmod" type="text" placeholder="Type your accuracy here..." maxlength="10" value="0.0002" autocomplete="off" />
248+
<div class='button mainPageBtn' onclick='setAccuracyModifier();'>Save</div>
249+
</div>
244250
<div class="footer"></div>
245251
</div>
246252
<script src="js/firebase.js" type="module"></script>

js/script.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const basic = {
1212
timer:null,
1313
hotcold: false,
1414
hotcolden:0,
15-
mid:3500
15+
mid:3500,
16+
acc:0.0002
1617
};
1718
let shareData = {
1819
title: "Takoma Park Orienteering",
@@ -310,7 +311,7 @@ let accuracyLat = (accuracy/(2*Math.PI*6371000*Math.cos(toRad(targetLat))/360)).
310311
//the code I was using before
311312
let withinAccuracy = calculateDistance(currentLat,currentLong,targetLat,targetLong) <= accuracy && position.coords.accuracy <= 15;*/
312313

313-
let accuracy = 0.0002;
314+
let accuracy = basic.acc;
314315
let withinAccuracy = Math.abs(currentLat - targetLat) <= accuracy && Math.abs(currentLong - targetLong) <= accuracy;
315316

316317
if (withinAccuracy) { //position.coords.accuracy <= 15 &&
@@ -633,6 +634,14 @@ const setName = function() {
633634
}
634635
tab(6);loadCourse();
635636
};
637+
const setAccuracyModifier = function() {
638+
const val = document.getElementById("accmod").value;
639+
if (val) {
640+
basic.acc = parsefload(document.getElementById("accmod").value);
641+
orienteering["skips"]++;
642+
}
643+
tab(6);
644+
};
636645
const skipBtn = function() {
637646
if (orienteering["currentControl"] != 0 && orienteering["currentControl"] < (basic.maps[orienteering["courseindex"]]["Controls"].length-1) && confirm("Are you sure you want to skip this control? You will be disqualified and score will not be added to leaderboard.")) {
638647
orienteering["currentControl"]++;

0 commit comments

Comments
 (0)