环境搭建
vscode安装Visual Studio Code - Code Editing. Redefined
nodejs安装Node.js — Run JavaScript Everywhere
cesium源码下载编译
cesium官网下载源码https://cesium.com/downloads/
解压下载的源码
VsCode打开远吗,找到index.html,右键打开 Open with Liver Server
查看界面
自己项目引入,引入Cesium-1.116\Build文件夹,注册token
新建html,编写代码
<div id="cesiumContainer"></div>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNmNkNDczYi05MDcyLTQxNzQtOTc5My1kNjg0ZWVkMDIyMGUiLCJpZCI6MjEyMDY3LCJpYXQiOjE3MTQzOTQ3NzB9.C-b_YMFf6wqH7yoUENLT3100XalNVYi-IxZu44_KLfI';
const viewer = new Cesium.Viewer("cesiumContainer");
viewer._cesiumWidget._creditContainer.style.display = "none";
// 去除logo
</script>
打开,球有了
源码目录结构分析
未完待续