Show waypoint photos from newer p4n2gpx exports
A newer p4n2gpx run (Ruby rewrite, ~/test/mapping/p4n2gpx) started emitting one plain GPX <link href> per park4night listing photo, which this app parsed but never displayed. Gpx.waypoint_photos collects them into a photos property; the waypoint popup renders them as a row of thumbnails above the description, each opening full-size in a new tab. Absent on older exports and plain GPS waypoints, so the row just doesn't render for those.
This commit is contained in:
1 parent
dd272ffb8a
commit
dd0ad6d845
6 files changed
+72
-2
No files matched your search
+12
-1
@@ -415,7 +415,8 @@ Like the radar overlay, GPX layers are removed by `map.setStyle()`
|
||||
whichever files were checked.
|
||||
|
||||
Waypoint popups:: Clicking a waypoint badge opens a MapLibre popup
|
||||
with its name, category (if any), description and time. Click/hover handling is
|
||||
with its name, category (if any), photos (if any), description and
|
||||
time. Click/hover handling is
|
||||
registered once per file (via `map.on(type, layerId, handler)`, a
|
||||
delegated listener that survives `setStyle()`) rather than on every
|
||||
`style.load` re-add, which would otherwise stack duplicate handlers
|
||||
@@ -442,6 +443,16 @@ before, one paragraph with line breaks. So this only ever adds
|
||||
structure on top of recognized lines; it never loses or hides text from
|
||||
files that don't have any.
|
||||
+
|
||||
A newer p4n2gpx export also emits one plain GPX `<link href>` per
|
||||
listing photo (not a vendor extension like `waypoint_style`'s
|
||||
`<osmand:*>` — `<link>` is base GPX 1.1, any number allowed per
|
||||
`<wpt>`/`<trk>`/`<rte>`). `Gpx.waypoint_photos` collects their `href`s
|
||||
into a `photos` property; `formatPhotos` renders them as a row of
|
||||
64px thumbnails above the description, each linking to the full-size
|
||||
image in a new tab. A plain GPS waypoint or an older export has none,
|
||||
so the row just doesn't render — same "only ever adds, never assumes"
|
||||
approach as the description formatting above.
|
||||
+
|
||||
`Services`/`Activities` get one further step (`formatMetaRow`,
|
||||
`formatTags`): the value is park4night's own comma-separated codes
|
||||
(`animaux, point_eau, wc_public`), which on their own told a reader
|
||||
|
||||
Reference in new issue
Block a user