Skip to content

Commit 9bb9892

Browse files
remove uses of followStreets
1 parent c479ae1 commit 9bb9892

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

lib/editor/actions/map/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export function handleControlPointDragStart (controlPoint: ControlPoint) {
247247

248248
export function removeControlPoint (controlPoints: Array<ControlPoint>, index: number, pattern: Pattern, patternCoordinates: any) {
249249
return async function (dispatch: dispatchFn, getState: getStateFn) {
250-
const {avoidMotorways, followStreets} = getState().editor.editSettings.present
250+
const {avoidMotorways, snapToOption} = getState().editor.editSettings.present
251251
const {
252252
coordinates,
253253
updatedControlPoints
@@ -257,8 +257,8 @@ export function removeControlPoint (controlPoints: Array<ControlPoint>, index: n
257257
controlPoints,
258258
editType: 'delete',
259259
index,
260-
followStreets,
261-
patternCoordinates
260+
patternCoordinates,
261+
snapToOption
262262
})
263263

264264
// Update the shape_dist_traveled values to reflect the new pattern that the bus follows

lib/editor/actions/map/stopStrategies.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ export function removeStopFromPattern (pattern: Pattern, stop: GtfsStop, index:
528528
console.log('pattern coordinates do not exist')
529529
patternStops.splice(index, 1)
530530
} else {
531-
const {avoidMotorways, followStreets} = getState().editor.editSettings.present
531+
const {avoidMotorways, snapToOption} = getState().editor.editSettings.present
532532
let result
533533
try {
534534
// $FlowFixMe: Flow does not recognize controlpoints within returned Promise type
@@ -537,8 +537,8 @@ export function removeStopFromPattern (pattern: Pattern, stop: GtfsStop, index:
537537
controlPoints: clonedControlPoints,
538538
editType: 'delete',
539539
index: cpIndex,
540-
followStreets,
541-
patternCoordinates: clonedPatternSegments
540+
patternCoordinates: clonedPatternSegments,
541+
snapToOption
542542
})
543543
} catch (err) {
544544
console.log(err)

lib/editor/components/pattern/EditShapePanel.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default class EditShapePanel extends Component<Props> {
4848
/**
4949
* Construct new pattern geometry from the pattern stop locations.
5050
*/
51-
async drawPatternFromStops (pattern: Pattern, stopsCoordinates: Array<LatLng>, followStreets: boolean): Promise<any> {
51+
async drawPatternFromStops (pattern: Pattern, stopsCoordinates: Array<LatLng>): Promise<any> {
5252
const {editSettings, saveActiveGtfsEntity, setErrorMessage, updatePatternGeometry} = this.props
5353
let patternSegments = []
5454
if (editSettings.present.snapToOption !== 'NONE') {
@@ -92,7 +92,7 @@ export default class EditShapePanel extends Component<Props> {
9292
}
9393

9494
_generateShapeFromStops = () => {
95-
const {activePattern, editSettings, stops} = this.props
95+
const {activePattern, stops} = this.props
9696
const stopLocations = stops && activePattern.patternStops && activePattern.patternStops.length
9797
? activePattern.patternStops
9898
.map((s, index) => {
@@ -104,7 +104,7 @@ export default class EditShapePanel extends Component<Props> {
104104
return {lng: stop.stop_lon, lat: stop.stop_lat}
105105
})
106106
: []
107-
this.drawPatternFromStops(activePattern, stopLocations, editSettings.present.followStreets)
107+
this.drawPatternFromStops(activePattern, stopLocations)
108108
}
109109

110110
_confirmCreateFromStops = () => {

lib/editor/reducers/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const reducers = {
4949
...defaultState,
5050
// Do not reset follow streets if exiting pattern editing.
5151
// TODO: Are there other edit settings that should not be overridden?
52-
followStreets: state.followStreets
52+
snapToOption: state.snapToOption
5353
}
5454
},
5555
'SETTING_ACTIVE_GTFS_ENTITY' (

0 commit comments

Comments
 (0)