Skip to content

Commit

Permalink
destroy tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Oct 2, 2023
1 parent 8363fc2 commit 0d352b9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions application/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "1.9.743",
"version_name": "together we are strong",
"version": "1.9.744",
"version_name": "hotline",
"name": "o.map",
"description": "O.map, your ultimate navigation companion for KaiOS-powered devices. O.map is a lightweight and feature-rich map application designed specifically for KaiOS, enabling you to explore and navigate the world with ease. Whether you're a local resident, a tourist, or an adventurer, O.map is here to enhance your journey and keep you on the right track.",
"launch_path": "/index.html",
Expand Down
2 changes: 1 addition & 1 deletion application/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],

"b2g_features": {
"version": "2.0.3",
"version": "2.0.4",
"id": "o.map",
"core": true,
"categories": ["utilities"],
Expand Down
16 changes: 10 additions & 6 deletions docs/assets/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,11 @@ const module = (() => {
}

if (action == "destroy_tracking") {
clearInterval(tracking_interval);

try{ localStorage.removeItem("tracking_cache");
}catch(e){console.log(e)}

tracking_altitude = [];
document.getElementById("tracking-altitude").innerText = "";
document.querySelector("div#tracking-distance").innerText = "";
Expand All @@ -852,21 +857,20 @@ const module = (() => {
document.querySelector("div#tracking-moving-time span").innerText = "";
document.querySelector("div#tracking-speed-average-time").innerText = "";
distances = [];
clearInterval(tracking_interval);
setTimeout(function () {
localStorage.removeItem("tracking_cache");
}, 10000);



tracking_group.clearLayers();
hotline_group.clearLayers();


polyline_tracking = L.polyline(tracking_latlngs, path_option).addTo(
tracking_group
);
status.tracking_running = false;
//gps_lock.unlock();
status.running = false;
status.live_track = false;

helper.side_toaster("tracking stopped", 2000);
return true;
}
Expand Down Expand Up @@ -915,7 +919,7 @@ const module = (() => {
let lastIntegerPart = 0;
tracking_interval = setInterval(function () {
// Only record data if accuracy is high enough
console.log("jj" + mainmarker.positionHasChanged);

if (mainmarker.accuracy > 10000 && mainmarker.positionHasChanged)
return false;

Expand Down
6 changes: 1 addition & 5 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2772,11 +2772,7 @@ document.addEventListener("DOMContentLoaded", function () {

case "6":
module.select_gpx();
module.pushLocalNotification(
"battery is weak",
"",
"/assets/image/battery.png"
);


break;

Expand Down
4 changes: 2 additions & 2 deletions docs/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "1.9.743",
"version_name": "together we are strong",
"version": "1.9.744",
"version_name": "hotline",
"name": "o.map",
"description": "O.map, your ultimate navigation companion for KaiOS-powered devices. O.map is a lightweight and feature-rich map application designed specifically for KaiOS, enabling you to explore and navigate the world with ease. Whether you're a local resident, a tourist, or an adventurer, O.map is here to enhance your journey and keep you on the right track.",
"launch_path": "/index.html",
Expand Down
2 changes: 1 addition & 1 deletion docs/manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],

"b2g_features": {
"version": "2.0.3",
"version": "2.0.4",
"id": "o.map",
"core": true,
"categories": ["utilities"],
Expand Down

0 comments on commit 0d352b9

Please sign in to comment.