From fccd3d0037f32df51f6f7d0dbe944b0df88c0491 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 25 Jun 2018 18:33:22 +0200 Subject: [PATCH] journeys: startWithWalking with default true :sparkles: cherry-picked 9305a12 from next --- docs/journeys.md | 4 +++- index.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/journeys.md b/docs/journeys.md index 6036c8d5..d928d361 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -62,7 +62,9 @@ With `opt`, you can override the default options, which look like this: regional: true }, tickets: false, // return tickets? only available with some profiles - polylines: false // return a shape for each leg? + polylines: false, // return a shape for each leg? + // Consider walking to nearby stations at the beginning of a journey? + startWithWalking: false } ``` diff --git a/index.js b/index.js index 9c81ce8b..f47d691c 100644 --- a/index.js +++ b/index.js @@ -86,7 +86,9 @@ const createClient = (profile, request = _request) => { accessibility: 'none', // 'none', 'partial' or 'complete' bike: false, // only bike-friendly journeys tickets: false, // return tickets? - polylines: false // return leg shapes? + polylines: false, // return leg shapes? + // Consider walking to nearby stations at the beginning of a journey? + startWithWalking: false }, opt) if (opt.via) opt.via = profile.formatLocation(profile, opt.via) opt.when = opt.when || new Date() @@ -128,6 +130,7 @@ const createClient = (profile, request = _request) => { jnyFltrL: filters, getTariff: !!opt.tickets, outFrwd: opt.whenRepresents !== 'arrival', + ushrp: !!opt.startWithWalking, // todo: what is req.gisFltrL? getPT: true, // todo: what is this?