Cesium环境搭建成功和初步看一下它的示例
Cesium是一款开源的基于JavaScript的3D地图框架。
官网描述:
CesiumJS is a geospatial 3D mapping platform for creating virtual globes. Our mission is to create the leading web-based globe and map for visualizing dynamic data. We strive for the best possible performance, precision, visual quality, ease of use, platform support, and content.
CesiumJS 是一款用于创建虚拟场景的3D地理信息平台。目标是用于创建以基于Web的地图动态数据可视化。目前尽力提升平台的性能、准确率、虚拟化能力、易用性以及平台的各种支持。
数据格式与功能特性
Cesium支持3D Tiles、Terrain and Imagery Layers、3D Models(glTF)、Vectors and Geometry(Load KML, GeoJSON, TopoJSON, and CZML)、Time-Dynamic Visualization、3D, 2D, and 2.5D Columbus View
环境搭建;node.js首先要安装;可参阅;
https://blog.****.net/bcbobo21cn/article/details/106110480
下载 Cesium 源码;解压以后如下;在此目录执行 npm install 命令;
网络不好有时会出现一些状况;如下;
deprecated
v. 对…表示极不赞成; 强烈反对;
再运行一次;好了;npm执行完;
在Cesium目录下多出 node_modules目录;如果没出现此目录就不能往下;
参照教程,要运行此目录下的server.js;但是我下的源码解压后只有一个server.cjs;把此文件保存一下,然后重命名为server.js,试一下;
执行node server.js;成功如下;提示 Cesium开发服务器正在运行;连接到本地8080端口;
网页进入localhost:8080;出现了Cesium的首页;到这环境就搭建成功;
看一下它的 示例,helloworld是地球;
http://localhost:8080/Apps/Sandcastle/index.html?src=3D%20Models.html
这个是场景和3D模型;
http://localhost:8080/Apps/Sandcastle/index.html?src=3D%20Tiles%20Photogrammetry.html
这是一个场景;
示例都有源码;应该可以参照来开发自己的3D地图应用了;