Skip to content

Commit

Permalink
Merge pull request #159 from OneBusAway/fix/vehicles-update-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbrethorst authored Jan 5, 2025
2 parents 45095be + c66f065 commit 237a76b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/stops/StopPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<p>{$t('no_arrivals_or_departures_in_next_30_minutes')}</p>
</div>
{:else}
{#key arrivalsAndDepartures.arrivalsAndDepartures}
{#key arrivalsAndDepartures.stopId}
<Accordion {handleAccordionSelectionChanged}>
{#each arrivalsAndDepartures.arrivalsAndDepartures as arrival}
<AccordionItem data={arrival}>
Expand Down
8 changes: 5 additions & 3 deletions src/lib/Provider/OpenStreetMapProvider.svelte.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,19 @@ export default class OpenStreetMapProvider {
marker.setLatLng([vehicleStatus.position.lat, vehicleStatus.position.lon]);
marker.setIcon(updatedIcon);

marker.vehicleData = {
let vehicleData = $state({
...marker.vehicleData,
nextDestination: activeTrip.tripHeadsign,
vehicleId: vehicleStatus.vehicleId,
lastUpdateTime: vehicleStatus.lastUpdateTime,
nextStopName: this.stopsMap.get(vehicleStatus.nextStop)?.name || 'N/A',
predicted: vehicleStatus.predicted
};
});

marker.vehicleData = vehicleData;

if (marker.isPopupOpen() && marker.popupComponent) {
marker.popupComponent.$set(marker.vehicleData);
marker.popupComponent = vehicleData;
}
}
removeVehicleMarker(marker) {
Expand Down

0 comments on commit 237a76b

Please sign in to comment.