Skip to content

Commit

Permalink
remove uses of followStreets
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-willis-arcadis committed Mar 6, 2025
1 parent c479ae1 commit 9bb9892
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/editor/actions/map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export function handleControlPointDragStart (controlPoint: ControlPoint) {

export function removeControlPoint (controlPoints: Array<ControlPoint>, index: number, pattern: Pattern, patternCoordinates: any) {
return async function (dispatch: dispatchFn, getState: getStateFn) {
const {avoidMotorways, followStreets} = getState().editor.editSettings.present
const {avoidMotorways, snapToOption} = getState().editor.editSettings.present
const {
coordinates,
updatedControlPoints
Expand All @@ -257,8 +257,8 @@ export function removeControlPoint (controlPoints: Array<ControlPoint>, index: n
controlPoints,
editType: 'delete',
index,
followStreets,
patternCoordinates
patternCoordinates,
snapToOption
})

// Update the shape_dist_traveled values to reflect the new pattern that the bus follows
Expand Down
6 changes: 3 additions & 3 deletions lib/editor/actions/map/stopStrategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ export function removeStopFromPattern (pattern: Pattern, stop: GtfsStop, index:
console.log('pattern coordinates do not exist')
patternStops.splice(index, 1)
} else {
const {avoidMotorways, followStreets} = getState().editor.editSettings.present
const {avoidMotorways, snapToOption} = getState().editor.editSettings.present
let result
try {
// $FlowFixMe: Flow does not recognize controlpoints within returned Promise type
Expand All @@ -537,8 +537,8 @@ export function removeStopFromPattern (pattern: Pattern, stop: GtfsStop, index:
controlPoints: clonedControlPoints,
editType: 'delete',
index: cpIndex,
followStreets,
patternCoordinates: clonedPatternSegments
patternCoordinates: clonedPatternSegments,
snapToOption
})
} catch (err) {
console.log(err)
Expand Down
6 changes: 3 additions & 3 deletions lib/editor/components/pattern/EditShapePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class EditShapePanel extends Component<Props> {
/**
* Construct new pattern geometry from the pattern stop locations.
*/
async drawPatternFromStops (pattern: Pattern, stopsCoordinates: Array<LatLng>, followStreets: boolean): Promise<any> {
async drawPatternFromStops (pattern: Pattern, stopsCoordinates: Array<LatLng>): Promise<any> {
const {editSettings, saveActiveGtfsEntity, setErrorMessage, updatePatternGeometry} = this.props
let patternSegments = []
if (editSettings.present.snapToOption !== 'NONE') {
Expand Down Expand Up @@ -92,7 +92,7 @@ export default class EditShapePanel extends Component<Props> {
}

_generateShapeFromStops = () => {
const {activePattern, editSettings, stops} = this.props
const {activePattern, stops} = this.props
const stopLocations = stops && activePattern.patternStops && activePattern.patternStops.length
? activePattern.patternStops
.map((s, index) => {
Expand All @@ -104,7 +104,7 @@ export default class EditShapePanel extends Component<Props> {
return {lng: stop.stop_lon, lat: stop.stop_lat}
})
: []
this.drawPatternFromStops(activePattern, stopLocations, editSettings.present.followStreets)
this.drawPatternFromStops(activePattern, stopLocations)
}

_confirmCreateFromStops = () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/reducers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const reducers = {
...defaultState,
// Do not reset follow streets if exiting pattern editing.
// TODO: Are there other edit settings that should not be overridden?
followStreets: state.followStreets
snapToOption: state.snapToOption
}
},
'SETTING_ACTIVE_GTFS_ENTITY' (
Expand Down

0 comments on commit 9bb9892

Please sign in to comment.