Commit d8f96916 by jlc

update:场景设置晨昏线案例的添加

parent debd056f
...@@ -50,6 +50,17 @@ ...@@ -50,6 +50,17 @@
</el-menu-item> </el-menu-item>
</el-sub-menu> </el-sub-menu>
<el-sub-menu index="13">
<template #title>
<el-icon><MapLocation /></el-icon>
<span>场景设置</span>
</template>
<el-menu-item v-for="item in elementSceneSet" :key="item.id" :index="item.title" @click="goAnchor(item.title)">
<el-icon><View /></el-icon>
<span>{{item.title}}</span>
</el-menu-item>
</el-sub-menu>
<el-sub-menu index="15"> <el-sub-menu index="15">
<template #title> <template #title>
<el-icon><SemiSelect /></el-icon> <el-icon><SemiSelect /></el-icon>
...@@ -69,18 +80,20 @@ ...@@ -69,18 +80,20 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { MapLocation, SemiSelect, Grid, View } from "@element-plus/icons-vue"; import { MapLocation, SemiSelect, Grid, View } from "@element-plus/icons-vue";
import { elementSpaceMissionsMap, elementStationMap, elementMovingMap, elementGraphicMap, elementWeatherMap } from '@/views/ElementMap'; import { elementSpaceMissionsMap, elementStationMap, elementMovingMap, elementGraphicMap, elementSceneSetMap, elementWeatherMap } from '@/views/ElementMap';
const elementSpaceMissions = ref() const elementSpaceMissions = ref()
const elementStation = ref() const elementStation = ref()
const elementMoving = ref() const elementMoving = ref()
const elementGraphic = ref() const elementGraphic = ref()
const elementSceneSet = ref()
const elementWeather = ref() const elementWeather = ref()
elementSpaceMissions.value = elementSpaceMissionsMap; elementSpaceMissions.value = elementSpaceMissionsMap;
elementStation.value = elementStationMap; elementStation.value = elementStationMap;
elementMoving.value = elementMovingMap; elementMoving.value = elementMovingMap;
elementGraphic.value = elementGraphicMap; elementGraphic.value = elementGraphicMap;
elementSceneSet.value = elementSceneSetMap;
elementWeather.value = elementWeatherMap; elementWeather.value = elementWeatherMap;
const props = defineProps({ const props = defineProps({
......
...@@ -17,6 +17,9 @@ import vueCodeCirclesAndEllipses from '@/examples/graphicElement/circlesAndEllip ...@@ -17,6 +17,9 @@ import vueCodeCirclesAndEllipses from '@/examples/graphicElement/circlesAndEllip
import vueCodeBox from '@/examples/graphicElement/box/box.vue?raw' import vueCodeBox from '@/examples/graphicElement/box/box.vue?raw'
import vueCodeStraightArrow from '@/examples/graphicElement/straightArrow/straightArrow.vue?raw' import vueCodeStraightArrow from '@/examples/graphicElement/straightArrow/straightArrow.vue?raw'
// 场景设置
import vueCodeTerminatorLine from '@/examples/sceneSet/terminatorLine/terminatorLine.vue?raw'
// 天气 // 天气
import vueCodeRain from '@/examples/weather/rain/rain.vue?raw' import vueCodeRain from '@/examples/weather/rain/rain.vue?raw'
import vueCodeSnow from '@/examples/weather/snow/snow.vue?raw' import vueCodeSnow from '@/examples/weather/snow/snow.vue?raw'
...@@ -44,6 +47,9 @@ const vueCodeMap = { ...@@ -44,6 +47,9 @@ const vueCodeMap = {
盒子: vueCodeBox, 盒子: vueCodeBox,
直线箭头: vueCodeStraightArrow, 直线箭头: vueCodeStraightArrow,
// 场景设置
晨昏线: vueCodeTerminatorLine,
// 天气 // 天气
: vueCodeRain, : vueCodeRain,
: vueCodeSnow, : vueCodeSnow,
......
...@@ -17,6 +17,9 @@ import functionCodeCirclesAndEllipses from '@/examples/graphicElement/circlesAnd ...@@ -17,6 +17,9 @@ import functionCodeCirclesAndEllipses from '@/examples/graphicElement/circlesAnd
import functionBox from '@/examples/graphicElement/box/box-function.js?raw' import functionBox from '@/examples/graphicElement/box/box-function.js?raw'
import functionStraightArrow from '@/examples/graphicElement/straightArrow/straightArrow-function.js?raw' import functionStraightArrow from '@/examples/graphicElement/straightArrow/straightArrow-function.js?raw'
// 场景设置
import functionCodeTerminatorLine from '@/examples/sceneSet/terminatorLine/terminatorLine-function.js?raw'
// 天气 // 天气
import functionCodeRain from '@/examples/weather/rain/rain-function.js?raw' import functionCodeRain from '@/examples/weather/rain/rain-function.js?raw'
import functionCodeSnow from '@/examples/weather/snow/snow-function.js?raw' import functionCodeSnow from '@/examples/weather/snow/snow-function.js?raw'
...@@ -44,6 +47,9 @@ const functionCodeMap = { ...@@ -44,6 +47,9 @@ const functionCodeMap = {
盒子: functionBox, 盒子: functionBox,
直线箭头: functionStraightArrow, 直线箭头: functionStraightArrow,
// 场景设置
晨昏线: functionCodeTerminatorLine,
// 天气 // 天气
: functionCodeRain, : functionCodeRain,
: functionCodeSnow, : functionCodeSnow,
......
export function addTerminatorLine() {
const script = document.createElement('script');
script.src = 'https://cesium.com/downloads/cesiumjs/releases/1.99/Build/Cesium/Cesium.js';
script.onload = () => {
window.Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI3Njg4ZWU5Yi1iZDhiLTRhYmUtOTRiYS04YjM5NmUwNjVmMDMiLCJpZCI6MjI3MzQ3LCJpYXQiOjE3MjA1MjA4Mjh9.E5XW4LnwgfVAaBC-znaYr61m4yK0-j2qEQhi9qwFFPE'
const viewer = new window.Cesium.Viewer('cesiumContainer', {
infoBox: false,
});
viewer.scene.globe.enableLighting = true;
};
document.head.appendChild(script);
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://cesium.com/downloads/cesiumjs/releases/1.119/Build/Cesium/Widgets/widgets.css';
document.head.appendChild(link);
}
<template>
<div id="cesiumContainer" class="cesium-container"></div>
</template>
<script setup>
import { onMounted } from 'vue';
import { addTerminatorLine } from './function';
onMounted(() => {
addTerminatorLine()
});
</script>
<style>
.cesium-container {
width: 100%;
height: 100vh;
}
</style>
\ No newline at end of file
// 太空任务
export const elementSpaceMissionsMap = { export const elementSpaceMissionsMap = {
月球轨道: { 月球轨道: {
title: '月球轨道', title: '月球轨道',
...@@ -5,6 +6,7 @@ export const elementSpaceMissionsMap = { ...@@ -5,6 +6,7 @@ export const elementSpaceMissionsMap = {
} }
} }
// 测站
export const elementStationMap = { export const elementStationMap = {
添加测站: { 添加测站: {
title: '添加测站', title: '添加测站',
...@@ -16,6 +18,7 @@ export const elementStationMap = { ...@@ -16,6 +18,7 @@ export const elementStationMap = {
} }
} }
// 动目标
export const elementMovingMap = { export const elementMovingMap = {
: { : {
title: '车', title: '车',
...@@ -35,6 +38,7 @@ export const elementMovingMap = { ...@@ -35,6 +38,7 @@ export const elementMovingMap = {
}, },
} }
// 图元
export const elementGraphicMap = { export const elementGraphicMap = {
: { : {
title: '点', title: '点',
...@@ -66,6 +70,15 @@ export const elementGraphicMap = { ...@@ -66,6 +70,15 @@ export const elementGraphicMap = {
} }
} }
// 场景设置
export const elementSceneSetMap = {
晨昏线: {
title: '晨昏线',
pngUrl: '/src/assets/TerminatorLine.png'
}
}
// 天气
export const elementWeatherMap = { export const elementWeatherMap = {
: { : {
title: '雨', title: '雨',
......
...@@ -36,6 +36,15 @@ ...@@ -36,6 +36,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="mt-5">
<span class="text-base font-bold">场景设置</span>
<div style="overflow-y: auto" class="container">
<div v-for="item in elementSceneSet" :key="item.id" @click="indexBtn(item.title)" class="item-container">
<div :id="item.title">{{item.title}}</div>
<img :src="item.pngUrl" width="250">
</div>
</div>
</div>
<div class="mt-10"> <div class="mt-10">
<span class="text-base font-bold">天气</span> <span class="text-base font-bold">天气</span>
<div style="overflow-y: auto" class="container"> <div style="overflow-y: auto" class="container">
...@@ -51,19 +60,21 @@ ...@@ -51,19 +60,21 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { elementSpaceMissionsMap, elementStationMap, elementMovingMap, elementGraphicMap, elementWeatherMap } from '@/views/ElementMap'; import { elementSpaceMissionsMap, elementStationMap, elementMovingMap, elementGraphicMap, elementSceneSetMap, elementWeatherMap } from '@/views/ElementMap';
const router = useRouter() const router = useRouter()
const elementSpaceMissions = ref() const elementSpaceMissions = ref()
const elementStation = ref() const elementStation = ref()
const elementMoving = ref() const elementMoving = ref()
const elementGraphic = ref() const elementGraphic = ref()
const elementSceneSet = ref()
const elementWeather = ref() const elementWeather = ref()
elementSpaceMissions.value = elementSpaceMissionsMap; elementSpaceMissions.value = elementSpaceMissionsMap;
elementStation.value = elementStationMap; elementStation.value = elementStationMap;
elementMoving.value = elementMovingMap; elementMoving.value = elementMovingMap;
elementGraphic.value = elementGraphicMap; elementGraphic.value = elementGraphicMap;
elementSceneSet.value = elementSceneSetMap;
elementWeather.value = elementWeatherMap; elementWeather.value = elementWeatherMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment