一、实现效果
二、功能描述
(1)支持二三维切换显示;
(2)支持平移、旋转、缩放;
(3)支持自然地球、夜晚地球等样式切换显示。
三、参考代码
cpp
//index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Vue Cesium Web GIS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
//main.ts
import { createApp } from 'vue';
import App from './App.vue';
const app = createApp(App);
app.mount('#app');
//App.vue
<template>
<div id="cesiumContainer" style="width: 100vw; height: 100vh"></div>
</template>
<script setup lang="ts">
import { ref, onMounted } from "vue";
import * as Cesium from "cesium";
onMounted(() => {
const viewer = new Cesium.Viewer("cesiumContainer", {
animation: false,
timeline: false,
});
});
</script>
欢迎关注我,一起交流!