@@ -72,41 +72,40 @@ const extractMarkerInformation = (
72
72
) : MarkerProperties [ ] =>
73
73
pathSteps
74
74
. map ( ( pathStep , index ) : MarkerProperties | null => {
75
+ if ( ! pathStep . coordinates ) return null ;
76
+
75
77
const matchingOp = suggestedOP
76
78
? suggestedOP . find ( ( op ) => matchPathStepAndOp ( pathStep , op ) )
77
79
: undefined ;
78
80
79
- if ( pathStep . coordinates ) {
80
- if ( pathStep . pointType === MARKER_TYPE . ORIGIN ) {
81
- return {
82
- coordinates : pathStep . coordinates ,
83
- type : MARKER_TYPE . ORIGIN ,
84
- imageSource : showStdcmAssets ? stdcmOrigin : originSVG ,
85
- op : matchingOp ,
86
- pathStep,
87
- } ;
88
- }
89
-
90
- if ( pathStep . pointType === MARKER_TYPE . DESTINATION ) {
91
- return {
92
- coordinates : pathStep . coordinates ,
93
- type : MARKER_TYPE . DESTINATION ,
94
- imageSource : showStdcmAssets ? stdcmDestination : destinationSVG ,
95
- op : matchingOp ,
96
- pathStep,
97
- } ;
98
- }
81
+ if ( pathStep . pointType === MARKER_TYPE . ORIGIN ) {
82
+ return {
83
+ coordinates : pathStep . coordinates ,
84
+ type : MARKER_TYPE . ORIGIN ,
85
+ imageSource : showStdcmAssets ? stdcmOrigin : originSVG ,
86
+ op : matchingOp ,
87
+ pathStep,
88
+ } ;
89
+ }
99
90
91
+ if ( pathStep . pointType === MARKER_TYPE . DESTINATION ) {
100
92
return {
101
93
coordinates : pathStep . coordinates ,
102
- type : MARKER_TYPE . VIA ,
103
- imageSource : showStdcmAssets ? stdcmVia : viaSVG ,
104
- index,
94
+ type : MARKER_TYPE . DESTINATION ,
95
+ imageSource : showStdcmAssets ? stdcmDestination : destinationSVG ,
105
96
op : matchingOp ,
106
97
pathStep,
107
98
} ;
108
99
}
109
- return null ;
100
+
101
+ return {
102
+ coordinates : pathStep . coordinates ,
103
+ type : MARKER_TYPE . VIA ,
104
+ imageSource : showStdcmAssets ? stdcmVia : viaSVG ,
105
+ index,
106
+ op : matchingOp ,
107
+ pathStep,
108
+ } ;
110
109
} )
111
110
. filter ( ( marker ) : marker is MarkerProperties => marker !== null ) ;
112
111
0 commit comments