Closed MichaelBonnet closed 1 year ago
of note, @/vasturiano's example does have a live working version, which does not seem to be having this issue.
Indeed, directly passing two strings rather than using the mapped ...tle
does not solve the problem:
const satData = tleData
.map(([name, ...tle]) => ({
satrec: satellite.twoline2satrec(
"1 11U 59001A 22053.83197560 .00000847 00000-0 45179-3 0 9996",
"2 11 32.8647 264.6509 1466352 126.0358 248.5175 11.85932318689790"
),
name: name.trim().replace(/^0 /, ""),
}))
Update: the issue was to use the following import line:
import * as satellite from "satellite.js";
I hope someone else finds this issue useful.
Hello,
I am trying to modify @/vasturiano's React globe with satellites example into just a React component. In attempting to do so, I get
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'twoline2satrec')
See the issue for yourself at this codesandbox link.
I'm a little confused, as mapping with
[name, ...tle]
and then passing...tle
to twoline2satrec() should be giving it the two TLE line strings as expected. What might I be doing wrong here? And why does this issue not appear in the example link's implementation?Actual direct code: