mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
26 lines
777 B
JavaScript
26 lines
777 B
JavaScript
'use strict'
|
|
|
|
const formatRadarReq = (ctx, north, west, south, east) => {
|
|
const {profile, opt} = ctx
|
|
|
|
return {
|
|
meth: 'JourneyGeoPos',
|
|
req: {
|
|
maxJny: opt.results,
|
|
onlyRT: false, // todo: does this mean "only realtime"?
|
|
date: profile.formatDate(profile, opt.when),
|
|
time: profile.formatTime(profile, opt.when),
|
|
// todo: would a ring work here as well?
|
|
rect: profile.formatRectangle(profile, north, west, south, east),
|
|
perSize: opt.duration * 1000,
|
|
perStep: Math.round(opt.duration / Math.max(opt.frames, 1) * 1000),
|
|
ageOfReport: true, // todo: what is this?
|
|
jnyFltrL: [
|
|
profile.formatProductsFilter(ctx, opt.products || {})
|
|
],
|
|
trainPosMode: 'CALC' // todo: what is this? what about realtime?
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = formatRadarReq
|