Keep a place page's map on its place after the list is applied

fitToVisible compared the whole list of a place page (every trail there, drawn
or not) with the drawn trails the page opened on, found them different, and
fitted the map to the extent of the visible tracks: the American Discovery
Trail's. Only trails with geometry now count on a place page (data-place).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-18 17:26:45 -07:00
1 parent cfa8026300
commit a0540d21d2
3 files changed
+31 -1

No files matched your search

+2 -1
View File
@@ -694,7 +694,8 @@ def overview_map(recs, label, *, wide=False, scope="", saved=False, place=None):
# The frame takes the shape of the ground it shows, within calm bounds, so the tracks fill it
# (style.css .browse__map); the drawing and the live map fit the same ground either way.
frame_attr += f' style="--frame-n: {frame_ratio(fr):.3f}"'
return Markup(f"""<figure class="mapfig{" mapfig--wide" if wide else ""}" data-map="overview" data-src="/data/overview.geojson"{ids_attr}{overview_bbox(recs, place)}{frame_attr}>
place_attr = " data-place" if place and not saved else ""
return Markup(f"""<figure class="mapfig{" mapfig--wide" if wide else ""}" data-map="overview" data-src="/data/overview.geojson"{ids_attr}{overview_bbox(recs, place)}{frame_attr}{place_attr}>
<div class="mapfig__frame">
<span class="mapfig__corner mapfig__corner--nw" aria-hidden="true"></span>
<div class="map" role="region" aria-label="{esc(label)}">