Skip to content

Commit 58892f7

Browse files
authored
Merge pull request #5600 from HSLdevcom/AB#364
AB#364 do not request direct car routing from/to a stop
2 parents cff8863 + 9bb716c commit 58892f7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/util/planParamUtil.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,10 @@ export function planQueryNeeded(
273273
}
274274
}
275275

276-
function getLocation(str) {
276+
function getLocation(str, planType) {
277277
const loc = otpToLocation(str);
278-
if (loc.gtfsId) {
278+
// direct car routing from/to a stop does not work
279+
if (loc.gtfsId && planType !== PLANTYPE.CAR) {
279280
return {
280281
location: {
281282
stopLocation: { stopLocationId: loc.gtfsId },
@@ -304,8 +305,8 @@ export function getPlanParams(
304305
planType,
305306
relaxSettings = false,
306307
) {
307-
const fromPlace = getLocation(from);
308-
const toPlace = getLocation(to);
308+
const fromPlace = getLocation(from, planType);
309+
const toPlace = getLocation(to, planType);
309310
const useLatestArrival = arriveBy === 'true';
310311
// estimate distance for search iteration heuristics
311312
const fromLocation = otpToLocation(from);

0 commit comments

Comments
 (0)