@@ -414,62 +414,6 @@ const createClient = (profile, userAgent, opt = {}) => {
414414 throw new Error ( 'not implemented' ) ;
415415 } ;
416416
417- const radar = async ( { north, west, south, east} , opt ) => {
418- if ( 'number' !== typeof north ) {
419- throw new TypeError ( 'north must be a number.' ) ;
420- }
421- if ( 'number' !== typeof west ) {
422- throw new TypeError ( 'west must be a number.' ) ;
423- }
424- if ( 'number' !== typeof south ) {
425- throw new TypeError ( 'south must be a number.' ) ;
426- }
427- if ( 'number' !== typeof east ) {
428- throw new TypeError ( 'east must be a number.' ) ;
429- }
430- // With a bounding box across the antimeridian, east (e.g. -175) might be smaller than west (e.g. 175).
431- // Likewise, across the north/south poles, north (e.g. -85) might be smaller than south (e.g. 85).
432- // In these cases, the terms north/south & east/west become rather arbitrary of course.
433- // see also https://antimeridian.readthedocs.io/en/stable/
434- // todo: how does HAFAS handle this?
435- if ( north === south ) {
436- throw new Error ( 'bbox.north must not be equal to bbox.south.' ) ;
437- }
438- if ( east === west ) {
439- throw new Error ( 'bbox.east must not be equal to bbox.west.' ) ;
440- }
441-
442- opt = Object . assign ( {
443- results : 256 , // maximum number of vehicles
444- duration : 30 , // compute frames for the next n seconds
445- // todo: what happens with `frames: 0`?
446- frames : 3 , // nr of frames to compute
447- products : null , // optionally an object of booleans
448- polylines : true , // return a track shape for each vehicle?
449- subStops : true , // parse & expose sub-stops of stations?
450- entrances : true , // parse & expose entrances of stops/stations?
451- } , opt || { } ) ;
452- opt . when = new Date ( opt . when || Date . now ( ) ) ;
453- if ( Number . isNaN ( Number ( opt . when ) ) ) {
454- throw new TypeError ( 'opt.when is invalid' ) ;
455- }
456-
457- const req = profile . formatRadarReq ( { profile, opt} , north , west , south , east ) ;
458-
459- const { res, common} = await profile . request ( { profile, opt} , userAgent , req ) ;
460- if ( ! Array . isArray ( res . jnyL ) ) {
461- return [ ] ;
462- }
463- const ctx = { profile, opt, common, res} ;
464-
465- const movements = res . jnyL . map ( m => profile . parseMovement ( ctx , m ) ) ;
466-
467- return {
468- movements,
469- realtimeDataUpdatedAt : null ,
470- } ;
471- } ;
472-
473417 const reachableFrom = async ( address , opt = { } ) => {
474418 validateLocation ( address , 'address' ) ;
475419
@@ -556,7 +500,8 @@ const createClient = (profile, userAgent, opt = {}) => {
556500 if ( profile . tripsByName ) {
557501 client . tripsByName = tripsByName ;
558502 }
559- /*if (profile.radar) {
503+
504+ /* if (profile.radar) {
560505 client.radar = radar;
561506 }*/
562507 if ( profile . reachableFrom ) {
0 commit comments