代码拉取完成,页面将自动刷新
同步操作将从 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" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<script>
//创建一个基本地球
let viewer = new Cesium.Viewer("cesiumContainer", {
imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
url: 'http://t0.tianditu.gov.cn/img\_w/wmts?tk=0702d09e30dca11ed07ba4cec6d6bdac',
layer: 'img',
style: 'default',
tileMatrixSetID: 'w',
format: 'tiles',
maximumLevel: 18
}),
//terrainProvider: Cesium.createWorldTerrain(),
//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
});
viewer.cesiumWidget.creditContainer.style.display = "none";//去cesium logo水印
viewer.scene.debugShowFramesPerSecond = true;//开启帧数
//viewer.scene.globe.enableLighting = true;
//viewer.shadows = true;
//添加数据
////添加3dtiles
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: '测试辅助文件/Lab导出环氧乙烷/tileset.json', //数据路径
//url: '测试辅助文件/张单单大厦/tileset.json', //数据路径
// url: '测试辅助文件/测试小模型/tileset.json', //数据路径
maximumScreenSpaceError: 16, //最大的屏幕空间误差,数值越小,显示越精细
maximumNumberOfLoadedTiles: 1000, //最大加载瓦片个数
// modelMatrix: m //形状矩阵
}));
var boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(116.390123, 39.90691, 0), 1);
viewer.camera.flyToBoundingSphere(boundingSphere, { duration: 0 });
var utc = Cesium.JulianDate.fromDate(new Date("2019/10/04 10:30:00"));//UTC
viewer.clockViewModel.currentTime = Cesium.JulianDate.addHours(utc, 8, new Cesium.JulianDate());//北京时间=UTC+8=GMT+8
////下面是相关代码
var viewModel = {
blackAndWhiteShow: false,
blackAndWhiteGradations: 5.0,
brightnessShow: false,
brightnessValue: 0.5,
nightVisionShow: false,
silhouette: true,
};
if (
!Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)
) {
window.alert(
"This browser does not support the silhouette post process."
);
}
var stages = viewer.scene.postProcessStages;
var silhouette = stages.add(
Cesium.PostProcessStageLibrary.createSilhouetteStage()
);
var blackAndWhite = stages.add(
Cesium.PostProcessStageLibrary.createBlackAndWhiteStage()
);
var brightness = stages.add(
Cesium.PostProcessStageLibrary.createBrightnessStage()
);
var nightVision = stages.add(
Cesium.PostProcessStageLibrary.createNightVisionStage()
);
function updatePostProcess() {
silhouette.enabled = Boolean(viewModel.silhouette);
silhouette.uniforms.color = Cesium.Color.YELLOW;
blackAndWhite.enabled = Boolean(viewModel.blackAndWhiteShow);
blackAndWhite.uniforms.gradations = Number(
viewModel.blackAndWhiteGradations
);
brightness.enabled = Boolean(viewModel.brightnessShow);
brightness.uniforms.brightness = Number(viewModel.brightnessValue);
nightVision.enabled = Boolean(viewModel.nightVisionShow);
}
updatePostProcess();
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。