@@ -5,7 +5,7 @@ import {Alert, Checkbox, Form, FormControl, ControlLabel} from 'react-bootstrap'
5
5
import Rcslider from 'rc-slider'
6
6
7
7
import { updateEditSetting } from '../../actions/active'
8
- import { CLICK_OPTIONS } from '../../util'
8
+ import { CLICK_OPTIONS , SNAP_TO_OPTIONS } from '../../util'
9
9
import toSentenceCase from '../../../common/util/text'
10
10
import type { EditSettingsState } from '../../../types/reducers'
11
11
@@ -64,6 +64,7 @@ export default class EditSettings extends Component<Props, State> {
64
64
stopInterval
65
65
} = editSettings
66
66
const SETTINGS = [
67
+ // RAIL-TODO remove snap to streets
67
68
{ type : 'followStreets' , label : 'Snap to streets' } ,
68
69
{ type : 'avoidMotorways' , label : 'Avoid highways in routing' } ,
69
70
{ type : 'hideStopHandles' , label : 'Hide stop handles' } ,
@@ -75,6 +76,27 @@ export default class EditSettings extends Component<Props, State> {
75
76
const noSegmentIsActive = ! patternSegment && patternSegment !== 0
76
77
return (
77
78
< div >
79
+ < ControlLabel > < small > Snap to options</ small > </ ControlLabel >
80
+ < FormControl
81
+ componentClass = 'select'
82
+ value = { onMapClick }
83
+ name = { 'onMapClick' }
84
+ onChange = { this . _onSelectChange } >
85
+ { SNAP_TO_OPTIONS . map ( v => {
86
+ // ADD_STOPS_AT_INTERSECTIONS only enabled for nysdot extenstion
87
+ // (due to custom r5 deployment)
88
+ // FIXME: Temporarily disable add stops at intersection entirely
89
+ // (needs to be fixed for sql editor).
90
+ const disabled = v === 'ADD_STOPS_AT_INTERSECTIONS' // && !isExtensionEnabled('nysdot')
91
+ return (
92
+ < option
93
+ key = { v }
94
+ disabled = { disabled }
95
+ value = { v } > { toSentenceCase ( v . replace ( / _ / g, ' ' ) ) }
96
+ </ option >
97
+ )
98
+ } ) }
99
+ </ FormControl >
78
100
{ SETTINGS . map ( ( s , i ) => (
79
101
< Checkbox
80
102
checked = { editSettings [ s . type ] }
0 commit comments