Skip to content

Commit

Permalink
feat(frontend): ✨ Handle satellite data from celestrak in any format …
Browse files Browse the repository at this point in the history
…(#107)
  • Loading branch information
luctra02 authored and GitHub committed Feb 28, 2024
1 parent 2a63411 commit 54c78b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/map/SatelliteFetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ export default async function SatelliteFetcher({
(satEntity) => {
const celestrakURL = satEntity?.attributes?.celestrakURL;
if (celestrakURL) {
return celestrakURL;
return celestrakURL.replace(/FORMAT=[^&]*/, "FORMAT=TLE");
}
return (
"https://celestrak.org/NORAD/elements/gp.php?CATNR=" +
satEntity?.attributes?.catalogNumberNORAD +
"&FORMAT=TLE"
satEntity?.attributes?.catalogNumberNORAD
);
},
) as string[];
Expand Down

0 comments on commit 54c78b3

Please sign in to comment.