Skip to content

Commit 356c46e

Browse files
remove uses of followStreets
1 parent b809f44 commit 356c46e

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
@@ -244,7 +244,7 @@ export function handleControlPointDragStart (controlPoint: ControlPoint) {
244244

245245
export function removeControlPoint (controlPoints: Array<ControlPoint>, index: number, pattern: Pattern, patternCoordinates: any) {
246246
return async function (dispatch: dispatchFn, getState: getStateFn) {
247-
const {avoidMotorways, followStreets} = getState().editor.editSettings.present
247+
const {avoidMotorways, snapToOption} = getState().editor.editSettings.present
248248
const {
249249
coordinates,
250250
updatedControlPoints
@@ -253,8 +253,8 @@ export function removeControlPoint (controlPoints: Array<ControlPoint>, index: n
253253
controlPoints,
254254
editType: 'delete',
255255
index,
256-
followStreets,
257-
patternCoordinates
256+
patternCoordinates,
257+
snapToOption
258258
})
259259
// Update active pattern in store (does not save to server).
260260
dispatch(updatePatternGeometry({

lib/editor/actions/map/stopStrategies.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -504,16 +504,16 @@ export function removeStopFromPattern (pattern: Pattern, stop: GtfsStop, index:
504504
// If pattern has no shape points, don't attempt to refactor pattern shape
505505
console.log('pattern coordinates do not exist')
506506
} else {
507-
const {avoidMotorways, followStreets} = getState().editor.editSettings.present
507+
const {avoidMotorways, snapToOption} = getState().editor.editSettings.present
508508
let result
509509
try {
510510
result = await recalculateShape({
511511
avoidMotorways,
512512
controlPoints: clonedControlPoints,
513513
editType: 'delete',
514514
index: cpIndex,
515-
followStreets,
516-
patternCoordinates: clonedPatternSegments
515+
patternCoordinates: clonedPatternSegments,
516+
snapToOption
517517
})
518518
} catch (err) {
519519
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)