'优化操作逻辑'

This commit is contained in:
jiangteng 2023-02-06 14:14:20 +08:00
parent 7e8db73b6a
commit a4499f471a
2 changed files with 31 additions and 10 deletions

View File

@ -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")

View File

@ -13,6 +13,15 @@
<el-checkbox v-if="!item.type" :label="item.value">{{ item.label }}</el-checkbox>
</template>
</el-checkbox-group>
<el-row style="padding: 30px 0px;">
<el-button type="primary" @click="clearTLECache">
清除TLE缓存
</el-button>
<el-button type="primary" @click="clearSatelliteOrbit">
清除轨道
</el-button>
</el-row>
</el-drawer>
</template>
@ -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');
})