@@ -3,6 +3,7 @@ import { Box, Typography } from '@mui/material';
33import {
44 type GTFSFeedType ,
55 type GBFSVersionType ,
6+ type GBFSFeedType ,
67} from '../../services/feeds/utils' ;
78import { type LatLngTuple } from 'leaflet' ;
89import { type GeoJSONData , type GeoJSONDataGBFS } from '../../types' ;
@@ -192,36 +193,35 @@ export function computeBoundingBox(
192193}
193194
194195export const getBoundingBox = (
195- feed : GTFSFeedType ,
196+ feed : GTFSFeedType | GBFSFeedType ,
196197) : LatLngTuple [ ] | undefined => {
197- if ( feed == undefined || feed . data_type !== 'gtfs ') {
198+ if ( feed == undefined || feed . data_type === 'gtfs_rt ') {
198199 return undefined ;
199- }
200- const gtfsFeed : GTFSFeedType = feed ;
200+ } ;
201201 if (
202- gtfsFeed . bounding_box ?. maximum_latitude == undefined ||
203- gtfsFeed . bounding_box ?. maximum_longitude == undefined ||
204- gtfsFeed . bounding_box ?. minimum_latitude == undefined ||
205- gtfsFeed . bounding_box ?. minimum_longitude == undefined
202+ feed . bounding_box ?. maximum_latitude == undefined ||
203+ feed . bounding_box ?. maximum_longitude == undefined ||
204+ feed . bounding_box ?. minimum_latitude == undefined ||
205+ feed . bounding_box ?. minimum_longitude == undefined
206206 ) {
207207 return undefined ;
208208 }
209209 return [
210210 [
211- gtfsFeed . bounding_box . minimum_latitude ,
212- gtfsFeed . bounding_box . minimum_longitude ,
211+ feed . bounding_box . minimum_latitude ,
212+ feed . bounding_box . minimum_longitude ,
213213 ] ,
214214 [
215- gtfsFeed . bounding_box . minimum_latitude ,
216- gtfsFeed . bounding_box . maximum_longitude ,
215+ feed . bounding_box . minimum_latitude ,
216+ feed . bounding_box . maximum_longitude ,
217217 ] ,
218218 [
219- gtfsFeed . bounding_box . maximum_latitude ,
220- gtfsFeed . bounding_box . maximum_longitude ,
219+ feed . bounding_box . maximum_latitude ,
220+ feed . bounding_box . maximum_longitude ,
221221 ] ,
222222 [
223- gtfsFeed . bounding_box . maximum_latitude ,
224- gtfsFeed . bounding_box . minimum_longitude ,
223+ feed . bounding_box . maximum_latitude ,
224+ feed . bounding_box . minimum_longitude ,
225225 ] ,
226226 ] ;
227227} ;
0 commit comments