56 lines
1.8 KiB
HTML
56 lines
1.8 KiB
HTML
<!--
|
|
* @Descripttion:
|
|
* @version: 1.0.0
|
|
* @Author: zhangti
|
|
* @Date: 2020-03-05 03:58:30
|
|
* @LastEditors: zhangti
|
|
* @LastEditTime: 2020-07-23 21:58:26
|
|
-->
|
|
<div id="viewer-container"></div>
|
|
<script>
|
|
|
|
let viewer = new Cesium.Viewer("viewer-container", { infoBox: false, shouldAnimate: true });
|
|
|
|
let d3kit = new Cesium.D3Kit(viewer)
|
|
d3kit.setDefSceneConfig()
|
|
d3kit.setBloomLightScene()
|
|
let layer = viewer.imageryLayers.addImageryProvider(new Cesium.BaiduImageryProvider({
|
|
style: 'dark'
|
|
}));
|
|
let tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
|
|
url: 'data/3DTiles/building/tileset.json'
|
|
}))
|
|
tileset.style = new Cesium.Cesium3DTileStyle({
|
|
color: {
|
|
conditions: [
|
|
["${height} >= 300", "rgba(0, 149, 251, 0.3)"],
|
|
["${height} >= 200", "rgb(0, 149, 251, 0.3)"],
|
|
["${height} >= 100", "rgb(0, 149, 251, 0.3)"],
|
|
["${height} >= 50", "rgb(0, 149, 251, 0.3)"],
|
|
["${height} >= 25", "rgb(0, 149, 251, 0.3)"],
|
|
["${height} >= 10", "rgb(0, 149, 251, 0.3)"],
|
|
["${height} >= 5", "rgb(0, 149, 251, 0.3)"],
|
|
["true", "rgb(0, 149, 251, 0.3)"]
|
|
]
|
|
}
|
|
});
|
|
d3kit.flyTo({
|
|
position: { x: -1337132.0092982147, y: 5330611.474631115, z: 3228680.029449292 },
|
|
orientation: {
|
|
heading: Cesium.Math.toRadians(1.0114629015290062),
|
|
pitch: Cesium.Math.toRadians(-23.53661660731824),
|
|
roll: Cesium.Math.toRadians(0.00324596311071617)
|
|
}
|
|
})
|
|
|
|
d3kit.createPointsGraphics({
|
|
positions: [Cesium.Cartesian3.fromDegrees(104.081701757991, 30.627042558105988, 400.0)],
|
|
billboard: {
|
|
b_img: 'data/images/Textures/billboard2.png',
|
|
b_width: 40,
|
|
b_height: 25,
|
|
b_scale: 1.5,
|
|
b_scaleByDistance: new Cesium.NearFarScalar(1.5e2, 2.0, 1.5e7, 0.5)
|
|
}
|
|
})
|
|
</script> |