diff --git a/src/tabs/MapTab.tsx b/src/tabs/MapTab.tsx index 1e244bc..9d1b0a5 100644 --- a/src/tabs/MapTab.tsx +++ b/src/tabs/MapTab.tsx @@ -360,71 +360,63 @@ export default function MapTab({ vehicles, routes, gtfsApi, workerApi }: MapTabP return ( - {vehiclesWithDetails.length === 0 ? ( - - No vehicle positions available - - ) : ( - <> - - - {shapesGeoJson && ( - - )} - - + + {shapesGeoJson && ( + + )} + + + {vehiclesWithDetails.map((vd, idx) => { + if (!vd.vehicle.position?.latitude || !vd.vehicle.position?.longitude) return null + + const textColor = vd.route?.route_text_color ? `#${vd.route.route_text_color}` : '#000000' + const bgColor = vd.route?.route_color ? `#${vd.route.route_color}` : '#CCCCCC' + const tripLabel = vd.trip?.trip_short_name || null + const vehicleLabel = vd.vehicle.vehicle?.label || null + + return ( + handleMarkerClick(vd) + }} /> - {vehiclesWithDetails.map((vd, idx) => { - if (!vd.vehicle.position?.latitude || !vd.vehicle.position?.longitude) return null - - const textColor = vd.route?.route_text_color ? `#${vd.route.route_text_color}` : '#000000' - const bgColor = vd.route?.route_color ? `#${vd.route.route_color}` : '#CCCCCC' - const tripLabel = vd.trip?.trip_short_name || null - const vehicleLabel = vd.vehicle.vehicle?.label || null - - return ( - handleMarkerClick(vd) - }} - /> - ) - })} - - - {/* Recenter button */} - - - - - )} + ) + })} + + + {/* Recenter button */} + + + setDialogOpen(false)} maxWidth="sm" fullWidth>