From 0d352b9dd37eaf95e7921a6cffc557d4ee9eaaea Mon Sep 17 00:00:00 2001 From: strukturart Date: Mon, 2 Oct 2023 22:08:12 +0200 Subject: [PATCH] destroy tracking --- application/manifest.webapp | 4 ++-- application/manifest.webmanifest | 2 +- docs/assets/js/module.js | 16 ++++++++++------ docs/index.js | 6 +----- docs/manifest.webapp | 4 ++-- docs/manifest.webmanifest | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/application/manifest.webapp b/application/manifest.webapp index 9eb7ad05..19bfdc0d 100644 --- a/application/manifest.webapp +++ b/application/manifest.webapp @@ -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", diff --git a/application/manifest.webmanifest b/application/manifest.webmanifest index 58185bf1..fc7e66da 100644 --- a/application/manifest.webmanifest +++ b/application/manifest.webmanifest @@ -22,7 +22,7 @@ ], "b2g_features": { - "version": "2.0.3", + "version": "2.0.4", "id": "o.map", "core": true, "categories": ["utilities"], diff --git a/docs/assets/js/module.js b/docs/assets/js/module.js index 683cd65b..9f2d0934 100644 --- a/docs/assets/js/module.js +++ b/docs/assets/js/module.js @@ -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 = ""; @@ -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; } @@ -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; diff --git a/docs/index.js b/docs/index.js index 1fa29dd6..7dbfe833 100644 --- a/docs/index.js +++ b/docs/index.js @@ -2772,11 +2772,7 @@ document.addEventListener("DOMContentLoaded", function () { case "6": module.select_gpx(); - module.pushLocalNotification( - "battery is weak", - "", - "/assets/image/battery.png" - ); + break; diff --git a/docs/manifest.webapp b/docs/manifest.webapp index 9eb7ad05..19bfdc0d 100644 --- a/docs/manifest.webapp +++ b/docs/manifest.webapp @@ -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", diff --git a/docs/manifest.webmanifest b/docs/manifest.webmanifest index 58185bf1..fc7e66da 100644 --- a/docs/manifest.webmanifest +++ b/docs/manifest.webmanifest @@ -22,7 +22,7 @@ ], "b2g_features": { - "version": "2.0.3", + "version": "2.0.4", "id": "o.map", "core": true, "categories": ["utilities"],