94 lines
2.6 KiB
HTML
94 lines
2.6 KiB
HTML
<!--
|
|
* @Descripttion:
|
|
* @version: 1.0.0
|
|
* @Author: zhangti
|
|
* @Date: 2020-05-21 22:03:05
|
|
* @LastEditors: zhangti
|
|
* @LastEditTime: 2020-07-26 18:59:27
|
|
-->
|
|
<div id="viewer-container"></div>
|
|
<script>
|
|
let viewer = new Cesium.Viewer("viewer-container", { infoBox: false, shouldAnimate: true });
|
|
|
|
let d3kit = new Cesium.D3Kit(viewer)
|
|
|
|
let layer = viewer.imageryLayers.addImageryProvider(new Cesium.BaiduImageryProvider({
|
|
style: 'dark'
|
|
}));
|
|
|
|
d3kit.setDefSceneConfig()
|
|
d3kit.setBloomLightScene()
|
|
var tilesets = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
|
|
url: 'data/3DTiles/building/tileset.json'
|
|
}));
|
|
|
|
tilesets.readyPromise.then(function (tileset) {
|
|
|
|
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)"]
|
|
]
|
|
}
|
|
});
|
|
|
|
|
|
|
|
viewer.flyTo(tileset)
|
|
|
|
let material = d3kit.getCustomMaterialWall({
|
|
image: 'data/images/Textures/b2.png',
|
|
freely: 'vertical',
|
|
direction: '+',
|
|
count: 2,
|
|
color: Cesium.Color.RED,
|
|
duration: 2000
|
|
})
|
|
|
|
let material2 = d3kit.getCustomMaterialWall({
|
|
image: 'data/images/Textures/jsx2.png',
|
|
freely: 'cross',
|
|
direction: '+',
|
|
count: 5,
|
|
color: Cesium.Color.RED,
|
|
duration: 3000
|
|
})
|
|
|
|
let three = viewer.entities.add({
|
|
name: 'aaaaa',
|
|
wall: {
|
|
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
|
|
104.09816110606057, 30.659821965447698, 500.0,
|
|
104.1120972824757, 30.65330300319938, 500.0,
|
|
104.10758419863926, 30.64592470850288, 500.0,
|
|
104.09351691196979, 30.652434826507452, 500.0,
|
|
104.09816110606057, 30.659821965447698, 500.0,
|
|
]),
|
|
material: material2
|
|
}
|
|
})
|
|
|
|
let three2 = viewer.entities.add({
|
|
name: 'aaaaa',
|
|
wall: {
|
|
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
|
|
104.07263175401185, 30.647622150198725, 500.0,
|
|
104.06369117158526, 30.648834374000277, 500.0,
|
|
104.06437182811021, 30.62274533905387, 500.0,
|
|
104.07463538167119, 30.62285687644371, 500.0,
|
|
104.07263175401185, 30.647622150198725, 500.0
|
|
]),
|
|
material: material
|
|
}
|
|
})
|
|
|
|
});
|
|
|
|
</script> |