From 9305a129a81db9b842b811c664e26548dcfee23a 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: --- docs/changelog.md | 1 + docs/journeys.md | 4 +++- index.js | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 611bb464..95b0e004 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -17,6 +17,7 @@ This version is not fully backwords-compatible. Check out [the migration guide]( - ebe4fa6 `journeys()`/`journeyLeg()`: `opt.passedStations` → `opt.stopovers` 💥 - 3e672ee `journeys()`/`journeyLeg()`: `stopover.station` → `stopover.stop` 💥 - 021ae45: `journeys()`/`journeyLeg()`: leg stopovers: parse & expose platforms +- 85e0bdf `journeys()`: `startWithWalking` option with default `true` ✨ ## `2.7.0` diff --git a/docs/journeys.md b/docs/journeys.md index 972fe55d..0e8a5bc8 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -64,7 +64,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: true } ``` diff --git a/index.js b/index.js index 91d644f4..ca0f35e7 100644 --- a/index.js +++ b/index.js @@ -97,7 +97,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: true }, opt) if (opt.via) opt.via = profile.formatLocation(profile, opt.via, 'opt.via') @@ -147,6 +149,7 @@ const createClient = (profile, request = _request) => { jnyFltrL: filters, getTariff: !!opt.tickets, outFrwd, + ushrp: !!opt.startWithWalking, // todo: what is req.gisFltrL? getPT: true, // todo: what is this?