From a2709cb35ff4b69b0e13fee07f2cac345246808b Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sun, 9 Aug 2026 15:53:30 +0200 Subject: Clean up trail elevation controls This removes obsolete Leaflet elevation options that are no longer needed by the trail map setup. It also makes the temporary summary control clean itself up immediately after the GPX summary data has loaded, including removing the control before tearing down the hidden map. --- assets/static/js/trail.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'assets') diff --git a/assets/static/js/trail.js b/assets/static/js/trail.js index bca224d..a6d3f32 100644 --- a/assets/static/js/trail.js +++ b/assets/static/js/trail.js @@ -111,7 +111,9 @@ const create_display_control = (map, chart_element) => { followMarker: false, marker: "position-marker", + almostOver: false, distanceMarkers: false, + edgeScale: false, hotline: false, waypoints: "markers", @@ -177,7 +179,9 @@ const create_summary_control = () => { followMarker: false, marker: false, + almostOver: false, distanceMarkers: false, + edgeScale: false, hotline: false, waypoints: false, @@ -193,6 +197,7 @@ const create_summary_control = () => { return { control: summary_control, destroy: () => { + summary_control.remove(); map.remove(); map_element.remove(); }, @@ -448,7 +453,9 @@ const initialize_trail_map = (trail) => { summary_control.once("eledata_loaded", ({ track_info }) => { set_summary_values(track_info); - destroy_summary_control(); + setTimeout(() => { + destroy_summary_control(); + }, 0); }); summary_control.load(summary_gpx_url); -- cgit v1.3.1