diff --git a/README.md b/README.md index 8a0c657..fa686cf 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ ### [preview](https://jiangteng2019.github.io/satellite-track/) -1. In order to save performance, the satellite orbit data is displayed by clicking. -1. Data from celestrak. -1. The access speed of github pages is slow, and the TLE data and cesium data are large. Please wait patiently for the resources to load. +1. In order to save performance, satellite-track uses the following restrictions: click display of satellite orbital data, not full display, orbital data prediction for the next 24 hours, and only five constellation data can be selected at the same time; +1. Data from celestrak; +1. The access speed of github pages is slow, and the TLE data and cesium data are large. Please wait patiently for the resources to load; +1. If the spacecraft changes orbit frequently, the TLE cache needs to be cleared manually before use; ------------------------------------------- @@ -20,9 +21,10 @@ ### [预览](https://jiangteng2019.github.io/satellite-track/) -1. 为了节约性能,卫星轨道数据点击显示,而非全量显示; +1. 为了节约性能,satellite-track 使用了如下限制:卫星轨道数据点击显示,而非全量显示、轨道数据预测未来24小时、只能同时选择5个星座数据; 1. 数据来源于celestrak; 1. github pages 访问速度慢,TLE数据与cesium数据较大,请耐心等待资源加载; +1. 如果航天器变轨频繁,使用前需手动清除TLE缓存; [![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track") diff --git a/src/views/satellite-track/SatelliteTrack.vue b/src/views/satellite-track/SatelliteTrack.vue index 3a055d8..a0c0683 100644 --- a/src/views/satellite-track/SatelliteTrack.vue +++ b/src/views/satellite-track/SatelliteTrack.vue @@ -13,6 +13,15 @@ {{ item.label }} + + + 清除TLE缓存 + + + + 清除轨道 + + @@ -31,7 +40,6 @@ import { getTleDataFromExternal } from '@/http/index' import SatelliteEntity from '@/js/SatelliteEntity'; import { specialSatellite, weatherSatellite, communicationSatellite, navigationSatellite, scientificSatellite, miscellaneousSatellite } from "./satelliteType" -import { add } from 'lodash'; let allSatellite = [...specialSatellite, ...weatherSatellite, ...communicationSatellite, ...navigationSatellite, ...scientificSatellite, ...miscellaneousSatellite]; @@ -46,7 +54,7 @@ const satelliteMap = new Map(); // 响应式数据 const drawer = ref(false); -const checked = ref([]); +const checked = ref([1]); const clickedSatelliteArray = []; @@ -129,10 +137,7 @@ function addCesiumEventListener() { const pickedFeature = viewer.scene.pick(movement.position); console.log(pickedFeature); if (!Cesium.defined(pickedFeature)) { - clickedSatelliteArray.forEach(item => { - item.id.path.show = false; - }) - return; + } if (pickedFeature) { pickedFeature.id.path.show = new Cesium.ConstantProperty(true); @@ -148,6 +153,19 @@ function handleSatelliteChange(e) { } +function clearTLECache() { + localStorage.clear(); + ElMessage.success('清除成功') +} + +function clearSatelliteOrbit() { + if (clickedSatelliteArray.length) { + clickedSatelliteArray.forEach(item => { + item.id ? item.id.path.show = false : ''; + }) + } +} + // 获取tle数据,从缓存中获取,若无请求数据 @@ -209,6 +227,7 @@ onMounted(async () => { initCesium(); initTimeLine(); addCesiumEventListener(); + addSatellite('last-30-days'); })