mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
locations, nearby: opt.stations -> opt.stops 💥 📝
This commit is contained in:
parent
d7e439b948
commit
8f9b22e296
4 changed files with 9 additions and 9 deletions
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
8
index.js
8
index.js
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue