From 13afa4cff8cebdefdba2b43de75b8613eeac9c3d Mon Sep 17 00:00:00 2001 From: strukturart Date: Sat, 22 Jul 2023 12:53:41 +0200 Subject: [PATCH] remove gpx layer --- application/assets/js/module.js | 16 +++++++++++++++- application/index.html | 20 +++++++++++--------- application/index.js | 8 +++++++- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/application/assets/js/module.js b/application/assets/js/module.js index fc3c22aa..594f5363 100644 --- a/application/assets/js/module.js +++ b/application/assets/js/module.js @@ -363,6 +363,19 @@ const module = (() => { return markers_collection[index]; }; + let remove_gpx = function () { + let i = 0; + gpx_group.eachLayer(function (l) { + i++; + if (i == gpx_selection_count + 1) { + gpx_group.removeLayer(l); + helper.side_toaster("path removed", 2000); + status.windowOpen = "map"; + document.querySelector("div#finder").style.display = "none"; + } + }); + }; + //SELECT GPX let gpx_selection_count = 0; @@ -375,6 +388,7 @@ const module = (() => { gpx_group.eachLayer(function (l) { if (l.getBounds()) gpx_selection.push(l); }); + if (gpx_selection.length == 0) { helper.side_toaster("no gpx file to select", 2000); return false; @@ -980,7 +994,7 @@ const module = (() => { user_input, format_ms, format_s, - + remove_gpx, get_closest_point, pushLocalNotification, uniqueId, diff --git a/application/index.html b/application/index.html index 83c14f01..ae8f4e15 100644 --- a/application/index.html +++ b/application/index.html @@ -385,7 +385,7 @@

Export