From fa3017574b830ee18cadc6bfe1cd9a465f48e555 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Thu, 5 Feb 2026 13:26:18 +0100 Subject: Better unknown feed handling, handle UVIGO shuttle --- src/Enmarcha.Backend/Controllers/TileController.cs | 4 ++-- src/Enmarcha.Backend/Controllers/TransitController.cs | 2 +- src/frontend/app/routes/map.tsx | 5 ++++- src/frontend/app/routes/routes.tsx | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Enmarcha.Backend/Controllers/TileController.cs b/src/Enmarcha.Backend/Controllers/TileController.cs index 3fdedfb..44a2473 100644 --- a/src/Enmarcha.Backend/Controllers/TileController.cs +++ b/src/Enmarcha.Backend/Controllers/TileController.cs @@ -191,10 +191,10 @@ public class TileController : ControllerBase { return feedId switch { - "vitrasa" or "tussa" or "tranvias" => "bus", + "vitrasa" or "tussa" or "tranvias" or "shuttle" => "bus", "xunta" => "coach", "renfe" or "feve" => "train", - _ => throw new ArgumentException("Feed ID not a known type", feedId) + _ => "unknown" }; } diff --git a/src/Enmarcha.Backend/Controllers/TransitController.cs b/src/Enmarcha.Backend/Controllers/TransitController.cs index a0b8e39..93129f9 100644 --- a/src/Enmarcha.Backend/Controllers/TransitController.cs +++ b/src/Enmarcha.Backend/Controllers/TransitController.cs @@ -42,7 +42,7 @@ public class TransitController : ControllerBase using var activity = Telemetry.Source.StartActivity("GetRoutes"); if (feeds.Length == 0) { - feeds = ["tussa", "vitrasa", "tranvias", "feve"]; + feeds = ["tussa", "vitrasa", "tranvias", "feve", "shuttle"]; } activity?.SetTag("feeds", string.Join(",", feeds)); diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx index 07a805d..a8d745e 100644 --- a/src/frontend/app/routes/map.tsx +++ b/src/frontend/app/routes/map.tsx @@ -111,7 +111,10 @@ export default function StopMap() { }; const stopLayerFilter = useMemo(() => { - const filter: any[] = ["any"]; + const filter: any[] = [ + "any", + ["==", ["get", "transitKind"], "unknown"] + ]; if (showCitybusStops) { filter.push(["==", ["get", "transitKind"], "bus"]); } diff --git a/src/frontend/app/routes/routes.tsx b/src/frontend/app/routes/routes.tsx index 5f02b70..6d50186 100644 --- a/src/frontend/app/routes/routes.tsx +++ b/src/frontend/app/routes/routes.tsx @@ -14,7 +14,7 @@ export default function RoutesPage() { const { data: routes, isLoading } = useQuery({ queryKey: ["routes"], - queryFn: () => fetchRoutes(["tussa", "vitrasa", "tranvias", "feve"]), + queryFn: () => fetchRoutes(["vitrasa", "tranvias", "tussa", "feve", "shuttle"]), }); const filteredRoutes = routes?.filter( -- cgit v1.3