cesium 学习(四) Hello World
一、前言
之前的文章都是基础,搭建环境、部署Cesium、学习资料等等。现在简单入手,一个Hello World页面开发。
二、Hello World
感觉Hello World没有什么特别需要讲的,当然如果要去深究Cesium是如何加载的不再此说中。
其实搭建完环境、部署好Cesium之后,其实都有官方的Hello World:
也可以自己新建一个HelloWorld.html用来感受:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<!DOCTYPE html> <html lang="en"> <head> <!-- Use correct character set. --> <meta charset="utf-8"> <!-- Tell IE to use the latest, best version. --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Make the application on mobile take up the full browser screen and disable user scaling. --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <title>Hello World!</title> <script src="../Build/Cesium/Cesium.js"></script> <script src="../js/jquery-1.4.4.min.js"></script> <script src="../js/FileSaver.js"></script> <!-- <link rel="stylesheet" href="Sandcastle/templates/bucket.css"> --> <style> @import url(../Build/Cesium/Widgets/widgets.css); html, body, #cesiumContainer { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; } </style> </head> <body> <div id="cesiumContainer" class="fullSize"></div> <div id="inspector" style="position: absolute;top:20px;left: 10px;"></div> <script> var viewer = new Cesium.Viewer("cesiumContainer"); </script> </body> </html>