search: per-leg colored polylines + transit whole-day toggle

This commit is contained in:
Arnaud Delcasse
2026-06-04 21:39:31 +02:00
parent 4547a80315
commit 89a0c490a8
3 changed files with 66 additions and 82 deletions
@@ -26,6 +26,16 @@
<div class="accordion-inner">
<template x-if="results.public_transit?.number > 0">
<div class="transit-journeys">
<!-- Toggle Pareto best-options vs full-day listing. Reloads
the page with transit_whole_day flipped; the backend
switches transit-routing from PlanPareto to PlanProfile
across the requested day. -->
<button type="button" class="transit-whole-day-toggle"
:class="transitWholeDay ? 'is-active' : ''"
@click="toggleTransitWholeDay()">
{{ if $iconBus }}<img src="{{ $iconBus.RelPermalink }}" alt="" />{{ end }}
<span x-text="transitWholeDay ? 'Voir les meilleures options' : 'Voir tous les trajets de la journée'"></span>
</button>
<template x-for="(journey, index) in results.public_transit.results" :key="index">
<div class="transit-journey" @click="selectItem('transit', index, journey)" :class="{ 'active': isSelected('transit', index) }">
<!-- En-tête du trajet -->
@@ -422,14 +432,14 @@
}
});
// Déterminer la couleur et le style selon le type de leg
// Déterminer la couleur et le style selon le type de leg.
// routeColor is already canonical "#RRGGBB" (transit-routing
// emits it that way; the parcoursmob adapter normalises Transitous
// to match). No extra '#' prefix.
const isWalk = leg.mode === 'WALK';
let lineColor = '#888888'; // Gris par défaut pour la marche
if (!isWalk) {
// Utiliser la couleur de la route si disponible
lineColor = leg.routeColor ? '#' + leg.routeColor : '#283959';
}
const lineColor = isWalk
? '#888888'
: (leg.routeColor || '#283959');
// Ajouter le layer
map.addLayer({