locations, nearby: opt.stations -> opt.stops 💥 📝

This commit is contained in:
Jannis R 2019-01-23 12:58:05 +08:00
parent d7e439b948
commit 8f9b22e296
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
4 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@ With `opt`, you can override the default options, which look like this:
{
fuzzy: true // find only exact matches?
, results: 5 // how many search results?
, stations: true
, stops: true // return stops/stations?
, addresses: true
, poi: true // points of interest
, stationLines: false // parse & expose lines of the station?

View file

@ -11,7 +11,7 @@ With `opt`, you can override the default options, which look like this:
results: 8, // maximum number of results
distance: null, // maximum walking distance in meters
poi: false, // return points of interest?
stations: true, // return stations?
stops: true, // return stops/stations?
stationLines: false, // parse & expose lines of the station?
language: 'en' // language to get results in
}

View file

@ -1,8 +1,8 @@
'use strict'
const formatLocationFilter = (stations, addresses, poi) => {
if (stations && addresses && poi) return 'ALL'
return (stations ? 'S' : '') + (addresses ? 'A' : '') + (poi ? 'P' : '')
const formatLocationFilter = (stops, addresses, poi) => {
if (stops && addresses && poi) return 'ALL'
return (stops ? 'S' : '') + (addresses ? 'A' : '') + (poi ? 'P' : '')
}
module.exports = formatLocationFilter

View file

@ -297,13 +297,13 @@ const createClient = (profile, userAgent, request = _request) => {
opt = Object.assign({
fuzzy: true, // find only exact matches?
results: 5, // how many search results?
stations: true,
stops: true, // return stops/stations?
addresses: true,
poi: true, // points of interest
stationLines: false // parse & expose lines of the station?
}, opt)
const f = profile.formatLocationFilter(opt.stations, opt.addresses, opt.poi)
const f = profile.formatLocationFilter(opt.stops, opt.addresses, opt.poi)
return request(profile, userAgent, opt, {
cfg: {polyEnc: 'GPA'},
meth: 'LocMatch',
@ -353,7 +353,7 @@ const createClient = (profile, userAgent, request = _request) => {
results: 8, // maximum number of results
distance: null, // maximum walking distance in meters
poi: false, // return points of interest?
stations: true, // return stations?
stops: true, // return stops/stations?
stationLines: false // parse & expose lines of the station?
}, opt)
@ -370,7 +370,7 @@ const createClient = (profile, userAgent, request = _request) => {
minDist: 0
},
getPOIs: !!opt.poi,
getStops: !!opt.stations,
getStops: !!opt.stops,
maxLoc: opt.results
}
})