From f91431fefa0418b80dea1246aecac2c6a9dfc416 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 27 Oct 2026 14:54:05 +0100 Subject: web: GPX track loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - core: track::load_gpx_from_bytes (path wrapper delegates to it; same hardening: size cap, no entity expansion, direct-child ) - sidebar: 'Load GPX Track…' button + hidden .gpx file input; the track swaps in via remove_hills(FLAG_TRACK_POINT) + add_hills, so marker hill indices never shift (track hills always live at the end of the hill list) - rendering: desktop parity — consecutive visible points joined with round-cap strokes, width = scale*track_width/(dist_m*10) clamped to [1,1000] image px, red (blue when hidden by terrain); a Track width slider (50-1000 m, default 200) appears in Display once a track is loaded - track points and duplicates are excluded from guide dots, hover and click hit-testing (they are scenery, not markable peaks) --- crates/wipfel/src/markers.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/wipfel/src/markers.rs') diff --git a/crates/wipfel/src/markers.rs b/crates/wipfel/src/markers.rs index d024f2e..b8c00aa 100644 --- a/crates/wipfel/src/markers.rs +++ b/crates/wipfel/src/markers.rs @@ -46,7 +46,13 @@ pub fn nearest_hill( let mut best = None; let mut best_d = max_dist; for &i in &pan.visible { - if !show_hidden && pan.hills[i].flags & gipfel_core::hill::FLAG_HIDDEN != 0 { + let flags = pan.hills[i].flags; + if flags & gipfel_core::hill::FLAG_DUPLIC != 0 + || flags & gipfel_core::hill::FLAG_TRACK_POINT != 0 + { + continue; + } + if !show_hidden && flags & gipfel_core::hill::FLAG_HIDDEN != 0 { continue; } let h = &pan.hills[i]; -- cgit v1.2.3