Skip to content

Commit

Permalink
Merge pull request #794 from ibi-group/transit-overlay-correct-units
Browse files Browse the repository at this point in the history
fix(transit-vehicle-overlay): use correct+consistent time units
  • Loading branch information
miles-grant-ibigroup authored Nov 13, 2024
2 parents 09986ce + 6ffcf98 commit 61b35e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/transit-vehicle-overlay/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ const TransitVehicleOverlay = ({
VehicleIcon = DefaultVehicleIcon,
vehicles
}: Props): ReactNode => {
const dateSeconds = Date.now() / 1000;
const validVehicles = vehicles?.filter(
vehicle =>
!!vehicle?.lat &&
!!vehicle?.lon &&
Date.now() - (vehicle?.lastUpdated || Date.now()) < maxVehicleAge
dateSeconds - (vehicle?.lastUpdated || dateSeconds) < maxVehicleAge
);
// Don't render if no map or no vehicles are defined.
// (ZoomBasedMarkers will also not render below the minimum zoom threshold defined in the symbols prop.)
Expand Down

0 comments on commit 61b35e4

Please sign in to comment.