diff --git a/frontend/public/earth/js/main.js b/frontend/public/earth/js/main.js index 9025cb79..e126d1e3 100644 --- a/frontend/public/earth/js/main.js +++ b/frontend/public/earth/js/main.js @@ -191,16 +191,27 @@ async function loadData(showWhiteSphere = false) { setLoading(true); try { - console.log('开始加载电缆数据...'); - await loadGeoJSONFromPath(scene, getEarth()); - console.log('电缆数据加载完成'); - await loadLandingPoints(scene, getEarth()); - console.log('登陆点数据加载完成'); - - const satCount = await loadSatellites(); - console.log(`卫星数据加载完成: ${satCount} 颗`); - updateSatellitePositions(); - console.log('卫星位置已更新'); + console.log('开始加载数据...'); + await Promise.all([ + (async () => { + await loadGeoJSONFromPath(scene, getEarth()); + console.log('电缆数据加载完成'); + await loadLandingPoints(scene, getEarth()); + console.log('登陆点数据加载完成'); + })(), + (async () => { + const satCount = await loadSatellites(); + console.log(`卫星数据加载完成: ${satCount} 颗`); + updateSatellitePositions(); + console.log('卫星位置已更新'); + toggleSatellites(true); + const satBtn = document.getElementById('toggle-satellites'); + if (satBtn) { + satBtn.classList.add('active'); + satBtn.querySelector('.tooltip').textContent = '隐藏卫星'; + } + })() + ]); } catch (error) { console.error('加载数据失败:', error); showStatusMessage('加载数据失败: ' + error.message, 'error'); diff --git a/frontend/public/earth/js/satellites.js b/frontend/public/earth/js/satellites.js index 60b6c879..06a513dd 100644 --- a/frontend/public/earth/js/satellites.js +++ b/frontend/public/earth/js/satellites.js @@ -291,9 +291,9 @@ export function updateSatellitePositions(deltaTime = 0) { trailColors[trailIdx + 1] = g * alpha; trailColors[trailIdx + 2] = b * alpha; } else { - trailPositions[trailIdx] = 0; - trailPositions[trailIdx + 1] = 0; - trailPositions[trailIdx + 2] = 0; + trailPositions[trailIdx] = pos.x; + trailPositions[trailIdx + 1] = pos.y; + trailPositions[trailIdx + 2] = pos.z; trailColors[trailIdx] = 0; trailColors[trailIdx + 1] = 0; trailColors[trailIdx + 2] = 0;