diff --git a/packages/map/components/Markers/StationMarker.tsx b/packages/map/components/Markers/StationMarker.tsx index 858c9d1..11ac8dd 100644 --- a/packages/map/components/Markers/StationMarker.tsx +++ b/packages/map/components/Markers/StationMarker.tsx @@ -38,7 +38,11 @@ export const StationMarker = ({ station }: StationMarkerProps) => { const { colorScheme } = useMantineColorScheme(); let botIcon = "/markers/icon-bot-simrail.jpg"; - if (colorScheme === "dark" || colorScheme === "auto" && window.matchMedia('(prefers-color-scheme: dark)').matches) + if ( + colorScheme === "dark" || + (colorScheme === "auto" && + window.matchMedia("(prefers-color-scheme: dark)").matches) + ) botIcon = "/markers/icon-bot-simrail-dark.jpg"; const icon = L.icon({ diff --git a/packages/map/components/Markers/TrainMarker.tsx b/packages/map/components/Markers/TrainMarker.tsx index f7d49e7..6c22c28 100644 --- a/packages/map/components/Markers/TrainMarker.tsx +++ b/packages/map/components/Markers/TrainMarker.tsx @@ -33,9 +33,12 @@ const TrainMarker = ({ train }: TrainMarkerProps) => { const { colorScheme } = useMantineColorScheme(); - let botIcon = "/markers/icon-bot-simrail.jpg"; - if (colorScheme === "dark" || colorScheme === "auto" && window.matchMedia('(prefers-color-scheme: dark)').matches) + if ( + colorScheme === "dark" || + (colorScheme === "auto" && + window.matchMedia("(prefers-color-scheme: dark)").matches) + ) botIcon = "/markers/icon-bot-simrail-dark.jpg"; const icon = L.icon({ diff --git a/packages/map/components/TrainText.tsx b/packages/map/components/TrainText.tsx index 57cca2a..7d08ec8 100644 --- a/packages/map/components/TrainText.tsx +++ b/packages/map/components/TrainText.tsx @@ -138,6 +138,8 @@ const TrainText = ({ // only the first unit is responsible for train traction at the moment, so this is just safe to assume // Not true anymore,- // don't think it was true before update either as EMUs prob had multiple traction + const roundedSpeed = Math.round(train.TrainData.Velocity); + // however, this might be wrong in case the first unit is not yet registered in railcars.json, so we just // fall back to displaying the raw api name in that case const tractionUnit = locomotives.at(0); @@ -242,8 +244,17 @@ const TrainText = ({ {!minified &&