const onViewerReady = (readyObj: VcReadyObject) => { Cesium = readyObj.Cesium; viewer = readyObj.viewer; viewer.scene.globe.depthTestAgainstTerrain = true; }; 用JavaScript语言怎么写
时间: 2024-01-08 21:04:43 浏览: 72
第03章-Cesium.js与React.js的碰撞:打造三维地球应用入门指南
可以这么写:
```javascript
const onViewerReady = function(readyObj) {
Cesium = readyObj.Cesium;
viewer = readyObj.viewer;
viewer.scene.globe.depthTestAgainstTerrain = true;
};
```
或者使用箭头函数:
```javascript
const onViewerReady = (readyObj) => {
Cesium = readyObj.Cesium;
viewer = readyObj.viewer;
viewer.scene.globe.depthTestAgainstTerrain = true;
};
```
阅读全文