Skip to content

Commit d898bad

Browse files
committed
feat(core-utils): restore walkSpeed param for walk-only trips
1 parent 5cab01d commit d898bad

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

packages/core-utils/src/query-params.js

+29
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,33 @@ const queryParams = [
163163
default: true
164164
},
165165

166+
{
167+
/* walkSpeed -- the user's walking speed in m/s */
168+
name: "walkSpeed",
169+
routingTypes: ["ITINERARY", "PROFILE"],
170+
default: 1.34,
171+
selector: "DROPDOWN",
172+
label: "Walk Speed",
173+
applicable: query =>
174+
query.mode &&
175+
!hasTransit(query.mode) && // Only applicable for walk-only trips (see walkTolerance for transit+walk)
176+
query.mode.indexOf("WALK") !== -1,
177+
options: [
178+
{
179+
text: "2 MPH",
180+
value: 0.89
181+
},
182+
{
183+
text: "3 MPH",
184+
value: 1.34
185+
},
186+
{
187+
text: "4 MPH",
188+
value: 1.79
189+
}
190+
]
191+
},
192+
166193
{
167194
/* maxWalkDistance - the maximum distance in meters the user will walk to transit. */
168195
name: "maxWalkDistance",
@@ -365,6 +392,7 @@ const queryParams = [
365392
}
366393
]
367394
},
395+
368396
{
369397
name: "walkReluctance",
370398
routingTypes: ["ITINERARY", "PROFILE"],
@@ -382,6 +410,7 @@ const queryParams = [
382410
*/
383411
!!query.otp2 && query.mode && query.mode.indexOf("WALK") !== -1
384412
},
413+
385414
{
386415
/* maxBikeTime -- the maximum time the user will spend biking in minutes */
387416
name: "maxBikeTime",

packages/core-utils/src/query.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616

1717
export const defaultParams = [
1818
"wheelchair",
19-
"maxWalkDistance",
2019
"walkReluctance",
20+
"walkSpeed",
2121
"maxWalkTime",
2222
"maxBikeDistance",
2323
"maxBikeTime",

0 commit comments

Comments
 (0)