Skip to content

Commit a8c8974

Browse files
restore time display
1 parent 69e93af commit a8c8974

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

front/src/modules/simulationResult/components/SimulationResultsMap/TrainHoverPosition.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ function getFill(isSelectedTrain: boolean, ecoBlocks: boolean) {
2424
return '#333';
2525
}
2626

27-
function getSpeedLabel(isSelectedTrain: boolean, ecoBlocks: boolean, point: TrainPosition) {
27+
function getSpeedTimeLabel(isSelectedTrain: boolean, ecoBlocks: boolean, point: TrainPosition) {
2828
if (isSelectedTrain) {
29+
console.log(point.speedTime);
2930
return (
3031
<>
3132
<span
@@ -34,6 +35,7 @@ function getSpeedLabel(isSelectedTrain: boolean, ecoBlocks: boolean, point: Trai
3435
{Math.round(point?.speedTime?.speed ?? 0)}
3536
km/h
3637
</span>
38+
{point.speedTime && <span className="ml-2 small">{`${point.speedTime.time}`}</span>}
3739
</>
3840
);
3941
}
@@ -204,7 +206,7 @@ function TrainHoverPosition(props: TrainHoverPositionProps) {
204206
) {
205207
const { ecoBlocks } = get(allowancesSettings, train.id, {} as AllowancesSetting);
206208
const fill = getFill(isSelectedTrain as boolean, ecoBlocks);
207-
const label = getSpeedLabel(isSelectedTrain, ecoBlocks, point);
209+
const label = getSpeedTimeLabel(isSelectedTrain, ecoBlocks, point);
208210

209211
const zoomLengthFactor = getzoomPowerOf2LengthFactor(viewport);
210212
const [trainGeoJsonPath, headTriangle, rearTriangle] = getTrainPieces(

0 commit comments

Comments
 (0)