96 lines
3.5 KiB
HTML
96 lines
3.5 KiB
HTML
<!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>Learning Cesium!</title>
|
|
<script src="./Build/Cesium/Cesium.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>
|
|
<script>
|
|
Cesium.Ion.defaultAccessToken =
|
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5ZjRjNTZkNC01NDYxLTRhMjQtOGEwZC1kZjA3YzQ5YTJlZDkiLCJpZCI6MjYwODQsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1ODcxOTMwODN9.prGsSKyAW_9Ow5zHYPhbm3LsQL-ApQw5-5PNJkDaHi8";
|
|
|
|
var viewer = new Cesium.Viewer("cesiumContainer", {
|
|
geocoder: false, //位置查找
|
|
homeButton: false, //视图返回初始位置
|
|
sceneModePicker: true, //视角选择器
|
|
// baseLayerPicker:false,//底图选择器
|
|
navigationHelpButton: false, //导航帮助按钮
|
|
animation: false, //动画控制器
|
|
// creditContainer:"credit",//版权显示
|
|
timeline: false, //时间线
|
|
fullscreenButton: false, //全屏控件
|
|
vrButton: false,
|
|
infoBox:false,
|
|
selectionIndicator:false
|
|
});
|
|
// var viewer = new Cesium.Viewer('cesiumContainer', {
|
|
// terrainProvider: Cesium.createWorldTerrain()
|
|
// });
|
|
|
|
// var tileset = viewer.scene.primitives.add(
|
|
// new Cesium.Cesium3DTileset({
|
|
// url: Cesium.IonResource.fromAssetId(115448),
|
|
// })
|
|
// );
|
|
// viewer.zoomTo(tileset)
|
|
// var tileset = new Cesium.Cesium3DTileset({
|
|
// url: "./SampleData/cesiumlab/tileset.json",
|
|
// dynamicScreenSpaceError: true,
|
|
// dynamicScreenSpaceErrorDensity: 0.00278,
|
|
// dynamicScreenSpaceErrorFactor: 4.0,
|
|
// dynamicScreenSpaceErrorHeightFalloff: 0.25,
|
|
// });
|
|
// viewer.scene.primitives.add(tileset);
|
|
// viewer.zoomTo(tileset);
|
|
|
|
// function setTilesetHeightAndOffset(tileset, height, x, y) {
|
|
// x = x ? x : 0
|
|
// y = y ? y : 0
|
|
// let center
|
|
// if (tileset.boundingSphere) {
|
|
// // 3dtiles
|
|
// center = tileset.boundingSphere.center
|
|
// } else if (tileset._boundingSpheres && tileset._boundingSpheres.length > 0) {
|
|
// // Primitive
|
|
// center = tileset._boundingSpheres[0].center
|
|
// }
|
|
// const cartographic = Cesium.Cartographic.fromCartesian(center)
|
|
// const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0)
|
|
// const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude + x, cartographic.latitude + y, height)
|
|
// const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3())
|
|
// const modelMaxtrix = Cesium.Matrix4.fromTranslation(translation)
|
|
// tileset.modelMatrix = modelMaxtrix
|
|
// }
|
|
// tileset.readyPromise.then(function(tileset_){
|
|
// setTilesetHeightAndOffset(tileset_,-100)
|
|
// })
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|