@@ -65,23 +65,23 @@ function handleGraphHopperRouting (path: Path, individualLegs: boolean = false):
65
65
// Keep track of the segment point intervals to split the line segment at.
66
66
// This appears to be the most reliable way to split up the geometry
67
67
// (previously distance was used here, but that provided inconstent results).
68
- const segmentPointIndeces = [ 0 ]
69
- // Iterate over the instructions, accumulating segment point indeces at each
70
- // waypoint encountered. Indeces are used to slice the line geometry when
68
+ const segmentPointIndexes = [ 0 ]
69
+ // Iterate over the instructions, accumulating segment point indexes at each
70
+ // waypoint encountered. Indexes are used to slice the line geometry when
71
71
// individual legs are needed. NOTE: Waypoint === routing point provided in
72
72
// the request.
73
73
instructions . forEach ( ( instruction , i ) => {
74
74
if ( instruction . text . match ( / W a y p o i n t ( \d + ) / ) || i === instructions . length - 1 ) {
75
- segmentPointIndeces . push ( instruction . interval [ 0 ] )
75
+ segmentPointIndexes . push ( instruction . interval [ 0 ] )
76
76
}
77
77
} )
78
- // Once all of the indeces have been found, slice the decoded polyline up
79
- // at the provided indeces .
80
- if ( segmentPointIndeces . length > 2 ) {
81
- for ( var i = 1 ; i < segmentPointIndeces . length ; i ++ ) {
82
- // Get the indeces of the points that the entire path should be sliced at
78
+ // Once all of the indexes have been found, slice the decoded polyline up
79
+ // at the provided indexes .
80
+ if ( segmentPointIndexes . length > 2 ) {
81
+ for ( var i = 1 ; i < segmentPointIndexes . length ; i ++ ) {
82
+ // Get the indexes of the points that the entire path should be sliced at
83
83
// Note: 'to' index is incremented by one because it is not inclusive.
84
- const [ from , to ] = [ segmentPointIndeces [ i - 1 ] , segmentPointIndeces [ i ] + 1 ]
84
+ const [ from , to ] = [ segmentPointIndexes [ i - 1 ] , segmentPointIndexes [ i ] + 1 ]
85
85
const segment = decodedPolyline . slice ( from , to )
86
86
segments . push ( segment )
87
87
}
0 commit comments