fix: Add direct ISS position endpoint for globe tracking

- Add /sstv/iss-position endpoint that calculates ISS position directly
- Update JS to use new endpoint instead of /satellite/position
- Returns lat, lon, altitude, and optionally elevation/azimuth from observer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-29 16:31:35 +00:00
parent eacf6d4970
commit 9cb44c6273
2 changed files with 71 additions and 12 deletions

View File

@@ -180,20 +180,11 @@ const SSTV = (function() {
const storedLon = localStorage.getItem('observerLon') || -0.1278;
try {
const response = await fetch('/satellite/position', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
latitude: parseFloat(storedLat),
longitude: parseFloat(storedLon),
satellites: ['ISS']
})
});
const response = await fetch(`/sstv/iss-position?latitude=${storedLat}&longitude=${storedLon}`);
const data = await response.json();
if (data.status === 'success' && data.positions?.length > 0) {
issPosition = data.positions[0];
if (data.status === 'ok') {
issPosition = data;
updateIssDisplay();
renderGlobe();
}