Skip to content

Commit

Permalink
added the feature for hiding the bus route on back to button
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunsinghofficial committed Aug 16, 2024
1 parent 95f2b12 commit 59a82e3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/map/GoogleMap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
import StopMarker from './StopMarker.svelte';
import RouteMap from './RouteMap.svelte';
export let selectedTrip;
export let selectedTrip = null;
export let selectedRoute = null;
export let showRoute = false;
export let showRouteMap = false;
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -194,7 +195,7 @@
<div id="map"></div>
{#if selectedTrip}
{#if selectedTrip && showRouteMap}
<RouteMap {map} tripId={selectedTrip.tripId} />
{/if}
Expand Down
5 changes: 5 additions & 0 deletions src/components/oba/StopPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@
};
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 });
}
</script>

Expand Down
15 changes: 13 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
let selectedTrip = null;
let showRoute = false;
let selectedRoute = null;
let showRouteMap = false;
function stopSelected(event) {
stop = event.detail.stop;
Expand All @@ -27,12 +28,22 @@
shortName: event.detail.routeShortName
};
}
function handleUpdateRouteMap(event) {
showRouteMap = event.detail.show;
}
</script>

{#if stop}
<ModalPane on:close={closePane}>
<StopPane {stop} on:tripSelected={tripSelected} />
<StopPane {stop} on:tripSelected={tripSelected} on:updateRouteMap={handleUpdateRouteMap} />
</ModalPane>
{/if}

<GoogleMap {selectedTrip} {selectedRoute} on:stopSelected={stopSelected} {showRoute} />
<GoogleMap
{selectedTrip}
{selectedRoute}
on:stopSelected={stopSelected}
{showRoute}
{showRouteMap}
/>

0 comments on commit 59a82e3

Please sign in to comment.