Skip to content

Commit a69fee7

Browse files
add todo comments for routing and map components
1 parent 62907d3 commit a69fee7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/editor/util/map.js

+2
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export function getPatternEndPoint (pattern: Pattern, controlPoints?: Array<Cont
262262
throw new Error('Control point is missing coordinates')
263263
}
264264

265+
// RAIL-TODO: remove followRoad for generic routing options
265266
/* eslint-disable complexity */
266267
export async function recalculateShape ({
267268
avoidMotorways = false,
@@ -396,6 +397,7 @@ export async function recalculateShape ({
396397
throw new Error('Invalid editType. Must be either "update" or "delete".')
397398
}
398399
// calculate new segment (valhalla or straight line)
400+
// RAIL-TODO: remove followRoad for generic routing options
399401
const newSegment = await getSegment(
400402
pointsToRoute,
401403
followStreets,

lib/scenario-editor/utils/valhalla.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export async function polyline (
134134
const beginIndex = i + offset
135135
const endIndex = i + chunk + offset
136136
const chunkedPoints = points.slice(beginIndex, endIndex)
137-
json = await routeWithGraphHopper(chunkedPoints, avoidMotorways)
137+
json = await routeWithGraphHopper(chunkedPoints, avoidMotorways) // RAIL-TODO: if snap to rail is enabled, use rail routing
138138
const path = json && json.paths && json.paths[0]
139139
// Route between chunked list of points
140140
if (path) {
@@ -154,6 +154,7 @@ export async function polyline (
154154
}
155155
}
156156

157+
// RAIL-TODO: remove followRoad for generic routing options
157158
export async function getSegment (
158159
points: Coordinates,
159160
followRoad: boolean,
@@ -165,7 +166,7 @@ export async function getSegment (
165166
}> {
166167
// Store geometry to be returned here.
167168
let geometry
168-
if (followRoad) {
169+
if (followRoad) { // RAIL-TODO: remove followRoad and use new state variable
169170
// if snapping to streets, use routing service.
170171
const coordinates = await polyline(
171172
points.map(p => ({lng: p[0], lat: p[1]})),

lib/types/reducers.js

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export type EditSettingsState = {
216216
currentDragId: null | string,
217217
distanceFromIntersection: number,
218218
editGeometry: boolean,
219+
followRail: boolean,
219220
followStreets: boolean,
220221
hideInactiveSegments: boolean,
221222
hideStopHandles: boolean,

0 commit comments

Comments
 (0)