From a4499f471a65e06aba0679be458007f7c7b84f6f Mon Sep 17 00:00:00 2001
From: jiangteng <1348746268@qq.com>
Date: Mon, 6 Feb 2023 14:14:20 +0800
Subject: [PATCH] =?UTF-8?q?'=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C=E9=80=BB?=
=?UTF-8?q?=E8=BE=91'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 10 ++++---
src/views/satellite-track/SatelliteTrack.vue | 31 ++++++++++++++++----
2 files changed, 31 insertions(+), 10 deletions(-)
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缓存;
[](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');
})