adapt docs and examples to 40b559f 📝

This commit is contained in:
Jannis R 2018-03-16 17:28:48 +01:00
parent 40b559f80d
commit 89060afc8d
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
5 changed files with 26 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# `radar(north, west, south, east, [opt])`
# `radar({north, west, south, east}, [opt])`
Use this method to find all vehicles currently in an area. Note that it is not supported by every profile/endpoint.
@ -26,7 +26,12 @@ const vbbProfile = require('hafas-client/p/vbb')
const client = createClient(vbbProfile)
client.radar(52.52411, 13.41002, 52.51942, 13.41709, {results: 5})
client.radar({
north: 52.52411,
west: 13.41002,
south: 52.51942,
east: 13.41709
}, {results: 5})
.then(console.log)
.catch(console.error)
```

View file

@ -16,7 +16,12 @@ client.journeys('008010226', '008013456', {results: 1})
// latitude: 52.148842,
// longitude: 11.641705
// }, {distance: 200})
// client.radar(52.148364, 11.600826, 52.108486, 11.651451, {results: 10})
// client.radar({
// north: 52.148364,
// west: 11.600826,
// south: 52.108486,
// east: 11.651451
// }, {results: 10})
// .then(([journey]) => {
// const leg = journey.legs[0]

View file

@ -11,7 +11,12 @@ client.journeys('1291501', '8100002', {results: 1})
// client.locations('Salzburg', {results: 2})
// client.location('8100173') // Graz Hbf
// client.nearby(47.812851, 13.045604, {distance: 60})
// client.radar(47.827203, 13.001261, 47.773278, 13.07562, {results: 10})
// client.radar({
// north: 47.827203,
// west: 13.001261,
// south: 47.773278,
// east: 13.07562
// }, {results: 10})
.then((data) => {
console.log(require('util').inspect(data, {depth: null}))

View file

@ -11,7 +11,12 @@ client.journeys('900000003201', '900000024101', {results: 1})
// client.locations('Alexanderplatz', {results: 2})
// client.location('900000042101') // Spichernstr
// client.nearby(52.5137344, 13.4744798, {distance: 60})
// client.radar(52.52411, 13.41002, 52.51942, 13.41709, {results: 10})
// client.radar({
// north: 52.52411,
// west: 13.41002,
// south: 52.51942,
// east: 13.41709
// }, {results: 10})
.then((data) => {
console.log(require('util').inspect(data, {depth: null}))

View file

@ -38,7 +38,7 @@ npm install hafas-client
- [`locations(query, [opt])`](docs/locations.md) find stations, POIs and addresses
- [`location(id)`](docs/location.md) get details about a location
- [`nearby(location, [opt])`](docs/nearby.md) show stations & POIs around
- [`radar(north, west, south, east, [opt])`](docs/radar.md) find all vehicles currently in a certain area
- [`radar({north, west, south, east}, [opt])`](docs/radar.md) find all vehicles currently in a certain area
## Usage