summaryrefslogtreecommitdiff
path: root/crates/wipfel/src/markers.rs
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 14:54:05 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 14:54:22 +0100
commitf91431fefa0418b80dea1246aecac2c6a9dfc416 (patch)
treee0366a87ca243cf1292936ebe44807b301fbc392 /crates/wipfel/src/markers.rs
parentf519a707e32679ec512518afc3c56eeec03c260a (diff)
web: GPX track loading
- core: track::load_gpx_from_bytes (path wrapper delegates to it; same hardening: size cap, no entity expansion, direct-child <ele>) - 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)
Diffstat (limited to 'crates/wipfel/src/markers.rs')
-rw-r--r--crates/wipfel/src/markers.rs8
1 files changed, 7 insertions, 1 deletions
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];