@@ -12,7 +12,6 @@ import { mapValues, get } from 'lodash';
12
12
13
13
import { Viewport } from 'reducers/map' ;
14
14
import { AllowancesSetting , AllowancesSettings , Train } from 'reducers/osrdsimulation/types' ;
15
- import { sec2time } from 'utils/timeManipulation' ;
16
15
import { boundedValue } from 'utils/numbers' ;
17
16
import { getCurrentBearing } from 'utils/geometry' ;
18
17
import OrderedLayer from 'common/Map/Layers/OrderedLayer' ;
@@ -25,24 +24,26 @@ function getFill(isSelectedTrain: boolean, ecoBlocks: boolean) {
25
24
return '#333' ;
26
25
}
27
26
28
- function getSpeedAndTimeLabel ( isSelectedTrain : boolean , ecoBlocks : boolean , point : TrainPosition ) {
27
+ function getSpeedLabel ( isSelectedTrain : boolean , ecoBlocks : boolean , point : TrainPosition ) {
29
28
if ( isSelectedTrain ) {
30
29
return (
31
- < >
32
- < span
33
- className = { cx ( 'small' , 'font-weight-bold' , ecoBlocks ? 'text-secondary' : 'text-primary' ) }
34
- >
35
- { Math . round ( point ?. speedTime ?. speed ?? 0 ) }
36
- km/h
37
- </ span >
38
- < span className = "ml-2 small" > { point . speedTime && sec2time ( point . speedTime . time ) } </ span >
39
- </ >
30
+ < span
31
+ className = { cx (
32
+ 'train-speed-label' ,
33
+ 'small' ,
34
+ 'font-weight-bold' ,
35
+ ecoBlocks ? 'text-secondary' : 'text-primary'
36
+ ) }
37
+ >
38
+ { Math . round ( point ?. speedTime ?. speed ?? 0 ) }
39
+ km/h
40
+ </ span >
40
41
) ;
41
42
}
42
43
return (
43
44
< >
44
45
{ /* <small>{point.properties.name}</small> */ }
45
- < span className = "small ml-1 font-weight-bold text-muted" >
46
+ < span className = "train-speed-label small ml-1 font-weight-bold text-muted" >
46
47
{ Math . round ( point ?. speedTime ?. speed ) }
47
48
km/h
48
49
</ span >
@@ -206,7 +207,7 @@ function TrainHoverPosition(props: TrainHoverPositionProps) {
206
207
) {
207
208
const { ecoBlocks } = get ( allowancesSettings , train . id , { } as AllowancesSetting ) ;
208
209
const fill = getFill ( isSelectedTrain as boolean , ecoBlocks ) ;
209
- const label = getSpeedAndTimeLabel ( isSelectedTrain , ecoBlocks , point ) ;
210
+ const label = getSpeedLabel ( isSelectedTrain , ecoBlocks , point ) ;
210
211
211
212
const zoomLengthFactor = getzoomPowerOf2LengthFactor ( viewport ) ;
212
213
const [ trainGeoJsonPath , headTriangle , rearTriangle ] = getTrainPieces (
0 commit comments