Fix meta-row color regression, show Services/Activities as icon tags
The gray color from the previous commit landed on .gpx-popup__meta (the
whole row, label and value both) instead of just .gpx-popup__meta-label —
only the label was supposed to be muted, the value should read as normal
text same as the description above it.
While in there: Services/Activities were showing park4night's own raw,
comma-separated codes ("animaux, point_eau, wc_public"), which don't mean
anything to a reader on their own. PARK4NIGHT_TAGS (icons.js) maps the
codes p4n2gpx's exports actually use to a human label and, where the
National Park Service's icon set (already used for POI_ICONS) has a
reasonable match, a small icon — formatTags (gpx.js) renders each as an
icon+label tag instead of raw text. A code not in that table just falls
back to its own raw text, so nothing is ever hidden.
This commit is contained in:
1 parent
152a08f922
commit
fd8852c0e1
4 files changed
+193
-20
No files matched your search
+16
-2
@@ -348,12 +348,26 @@ single paragraph, it read as a wall of run-together text.
|
||||
`formatDescription` pulls out whichever lines match a recognizable
|
||||
`Label: value` shape (`Rating`/`Services`/`Activities`) or are a bare
|
||||
URL, and renders each kind with its own visual treatment (a bordered
|
||||
"meta" block with bold labels for the former, an isolated link line for
|
||||
the latter); everything else — the actual narrative, or a plain GPX
|
||||
"meta" block with a muted label for the former, an isolated link line
|
||||
for the latter); everything else — the actual narrative, or a plain GPX
|
||||
file's `<desc>` with none of this structure at all — renders exactly as
|
||||
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.
|
||||
+
|
||||
`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
|
||||
nothing — split on commas and looked up in `PARK4NIGHT_TAGS`
|
||||
(`public/js/icons.js`), each renders as a small icon + human label tag
|
||||
instead. That table covers the codes p4n2gpx's exports actually use
|
||||
(not park4night's whole API), with a human label always and an icon
|
||||
only where the icon set below has a reasonable match — most of the
|
||||
icons are National Park Service symbols again (same source/license as
|
||||
`POI_ICONS`), a few (bakery, wifi, vehicle wash, ...) have no NPS
|
||||
equivalent and get a label with no icon. A code this table doesn't
|
||||
cover at all just renders as its own raw text, same as before this
|
||||
existed — nothing p4n2gpx might add later is silently dropped.
|
||||
|
||||
Track properties:: Every track feature (both formats) also carries
|
||||
`distance_meters`, `elevation_gain_meters`, `duration_secs`,
|
||||
|
||||
Reference in new issue
Block a user