Awesome
hafas-monitor-trips-server
A server that manages HAFAS monitors.
Installation
npm install hafas-monitor-trips-server
Usage
const createServer = require('hafas-monitor-trips-server')
const server = createServer(hafas)
const subA = server.subscribe({
north: 52.51, south: 52.4, west: 13.35, east: 13.38
})
const subB = server.subscribe({
north: 52.505, south: 52.45, west: 13.355, east: 13.375
})
subA.on('stopover', stopover => console.log('A', stopover))
subB.on('stopover', stopover => console.log('B', stopover))
subA
andsubB
have overlapping bounding boxes, so they will share one monitor.hafas
is ahafas-client
/*-hafas
instance.subscribe(bbox)
returns anEventEmitter
, emitting the same events as ahafas-monitor-trips
instance.
See example.js
for a full example.
Contributing
If you have a question or need support using hafas-monitor-trips-server
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.