diff --git a/src/components/map/GoogleMap.svelte b/src/components/map/GoogleMap.svelte index 9d4a740..719c880 100644 --- a/src/components/map/GoogleMap.svelte +++ b/src/components/map/GoogleMap.svelte @@ -19,6 +19,7 @@ export let selectedRoute = null; export let showRoute = false; export let showRouteMap = false; + export let showAllStops = true; const dispatch = createEventDispatcher(); @@ -84,6 +85,11 @@ markers = []; } + $: if (showAllStops) { + clearAllMarkers(); + allStops.forEach((s) => addMarker(s)); + } + $: if (selectedRoute && showRoute) { clearAllMarkers(); const stopsToShow = allStops.filter((s) => s.routeIds.includes(selectedRoute.id)); diff --git a/src/components/oba/StopPane.svelte b/src/components/oba/StopPane.svelte index 0ed3cbb..c543eb4 100644 --- a/src/components/oba/StopPane.svelte +++ b/src/components/oba/StopPane.svelte @@ -6,6 +6,8 @@ export let stop; export let arrivalsAndDeparturesResponse = null; + export let showAllStops = true; + let arrivalsAndDepartures; let loading = false; let error; @@ -29,6 +31,11 @@ loading = false; } + $: if (showAllStops) { + showTripDetails = false; + selectedTripDetails = null; + } + $: (async (s, arrDep) => { // if the arrivalsAndDeparturesResponse is passed in, use that // instead of loading fresh data. @@ -67,13 +74,13 @@ showTripDetails = true; dispatch('tripSelected', selectedTripDetails); dispatch('updateRouteMap', { show: true }); - console.log('StopPane: Trip selected, showing route map'); } function handleCloseTripDetailModal() { showTripDetails = false; dispatch('tripSelected', null); dispatch('updateRouteMap', { show: false }); + dispatch('showAllStops'); } @@ -84,7 +91,7 @@ >