代码拉取完成,页面将自动刷新
同步操作将从 Cubic/CesiumStudy 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!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.min.js"></script>
<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"></div>
<div id='tool' style="float:left;position:absolute;left:10px;top:10px;"></div>
<script src='./js/baiduMap.js'> </script>
<script src='./js/CreateTestBtn.js'> </script>
<script>
var imageryProvider = new BaiduImageryProvider({
url: "http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",
});
//创建一个基本地球
let viewer = new Cesium.Viewer("cesiumContainer", {
imageryProvider: imageryProvider,
animation: false, //动画控制,默认true (图中1)
baseLayerPicker: false,//地图切换控件(底图以及地形图)是否显示,默认显示true (图中6)
fullscreenButton: true,//全屏按钮,默认显示true (图中4)
geocoder: false,//地名查找,默认true (图中9)
// timeline: false,//时间线,默认true (图中3)
vrButton: false,//双屏模式,默认不显示false
homeButton: true,//主页按钮,默认true (图中8)
infoBox: false,//点击要素之后显示的信息,默认true
selectionIndicator: true,//选中元素显示,默认true
shadows: true,
});
viewer.cesiumWidget.creditContainer.style.display = "none";//去cesium logo水印
viewer.scene.debugShowFramesPerSecond = true;//开启帧数
//viewer.scene.globe.enableLighting = true;
var shadowMap = viewer.shadowMap;
shadowMap.softShadows = true;
shadowMap.maximumDistance = 350.0;
shadowMap.size = 8192;
//添加数据
//添加文字
viewer.entities.add({
name: '文字',
position: Cesium.Cartesian3.fromDegrees(116.3904715, 39.90571),
label: {
text: '看这里',
font: '19px Helvetica',
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
fillColor: Cesium.Color.AZURE,
outlineColor: Cesium.Color.BLACK,
outlineWidth: 3,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, //垂直方向以底部来计算标签的位置
}
});
viewer.camera.moveStart.addEventListener(function () { console.log("相机移动了") });
/////
///
// viewer.camera.changed.addEventListener(function () { console.log(viewer.camera.directionWC) });
viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
var canvas = viewer.scene.canvas;
var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
var ellipsoid = viewer.scene.globe.ellipsoid;
var result = viewer.camera.pickEllipsoid(center, ellipsoid);
console.log(result);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
// alert("我也不懂这个是啥");
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。