cesium-d3kit/examples/point_rotate.html

45 lines
1.3 KiB
HTML
Raw Normal View History

2021-12-30 16:02:03 +08:00
<!--
* @Descripttion:
* @version: 1.0.0
* @Author: zhangti
* @Date: 2020-03-05 03:58:30
* @LastEditors: zhangti
* @LastEditTime: 2020-05-23 13:24:30
-->
<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'
}));
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(45, 0, 75, 0.6)'],
['${height} >= 200', 'rgba(102, 71, 151, 0.6)'],
['${height} >= 100', 'rgba(170, 162, 204, 0.6)'],
['${height} >= 50', 'rgba(224, 226, 238, 0.6)'],
['${height} >= 25', 'rgba(252, 230, 200, 0.6)'],
['${height} >= 10', 'rgba(248, 176, 87, 0.6)'],
['${height} >= 5', 'rgba(198, 106, 11, 0.6)'],
['true', 'rgba(127, 59, 8, 0.6)']
]
}
});
viewer.flyTo(tileset)
d3kit.setCameraEotateHeading({
lng: 104.081701757991,
lat: 30.627042558105988,
height: 15.8,
heading: 0.0,
pitch: 0.0,
roll: 0.0
})
</script>