From 37c38e925ac4022c8eae23b6b6502b875cf07372 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 20 Jun 2026 00:54:04 +0200 Subject: [PATCH] fix: add transport_mode to entry JSON serialisation in all three map templates; note bbox approach in isNearTrack --- themes/intotheeast/js/maplibre-utils.js | 3 +++ themes/intotheeast/templates/dailies.html.twig | 3 ++- themes/intotheeast/templates/map.html.twig | 3 ++- themes/intotheeast/templates/trip.html.twig | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/themes/intotheeast/js/maplibre-utils.js b/themes/intotheeast/js/maplibre-utils.js index 1a996e0..92d1218 100644 --- a/themes/intotheeast/js/maplibre-utils.js +++ b/themes/intotheeast/js/maplibre-utils.js @@ -183,6 +183,9 @@ if (Math.abs(pt[0] - markerLat) > degLat || Math.abs(pt[1] - markerLng) > degLng) continue; if (haversineKm(markerLat, markerLng, pt[0], pt[1]) <= thresholdKm) return true; } + // Always check the last point (may be skipped by stride=10). + // Note: per-point degree pre-filter in the loop is functionally equivalent + // to a per-file bounding-box skip at this data scale. var last = trackpoints[trackpoints.length - 1]; return haversineKm(markerLat, markerLng, last[0], last[1]) <= thresholdKm; } diff --git a/themes/intotheeast/templates/dailies.html.twig b/themes/intotheeast/templates/dailies.html.twig index 529b9bf..7b08e40 100644 --- a/themes/intotheeast/templates/dailies.html.twig +++ b/themes/intotheeast/templates/dailies.html.twig @@ -24,7 +24,8 @@ 'title': item.page.title, 'slug': item.page.slug, 'url': item.page.url, - 'force_connect': item.page.header.force_connect ? true : false + 'force_connect': item.page.header.force_connect ? true : false, + 'transport_mode': item.page.header.transport_mode ? item.page.header.transport_mode : null }]) %} {% endif %} {% endfor %} diff --git a/themes/intotheeast/templates/map.html.twig b/themes/intotheeast/templates/map.html.twig index dd32fcd..0dd10ca 100644 --- a/themes/intotheeast/templates/map.html.twig +++ b/themes/intotheeast/templates/map.html.twig @@ -28,7 +28,8 @@ 'date': entry.date|date('d M Y'), 'url': entry.url, 'hero': hero_url, - 'force_connect': entry.header.force_connect ? true : false + 'force_connect': entry.header.force_connect ? true : false, + 'transport_mode': entry.header.transport_mode ? entry.header.transport_mode : null }]) %} {% endif %} {% endfor %} diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index 126560a..1021515 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -95,7 +95,8 @@ 'slug': item.page.slug, 'title': item.page.title, 'url': item.page.url, - 'force_connect': item.page.header.force_connect ? true : false + 'force_connect': item.page.header.force_connect ? true : false, + 'transport_mode': item.page.header.transport_mode ? item.page.header.transport_mode : null }]) %} {% endif %} {% endfor %}