window.viewer.scene.primitives render重新渲染
时间: 2023-06-18 16:02:38 浏览: 89
在Cesium中,可以通过以下代码重新渲染场景中的primitive:
```
viewer.scene.requestRender();
```
这将会在下一帧重新渲染场景。如果你想要强制立即重新渲染,可以使用以下代码:
```
viewer.scene.render();
```
这将会立即重新渲染场景,但需要注意的是,如果你频繁地调用这个方法,会导致性能问题。
相关问题
window.viewer.scene.primitives._billboards 隐藏 。show
要隐藏 `window.viewer.scene.primitives._billboards`,可以使用以下代码:
```
window.viewer.scene.primitives._billboards.show = false;
```
要显示它,可以使用以下代码:
```
window.viewer.scene.primitives._billboards.show = true;
```
请注意,这是一种 hacky 的方式来访问 viewer 中的私有属性,可能会在未来的 Cesium 版本中发生变化。建议使用 Cesium 提供的公共 API 来进行更可靠的操作。
viewer.scene.primitives.getById is not a function
The error message "viewer.scene.primitives.getById is not a function" is typically caused by attempting to call the getById method on an object that does not have this method defined.
One possible solution is to check if the object you are calling the method on is actually an instance of the correct class. Another solution could be to check if the method is defined on a different object that you can access.
It would be helpful to see the code that is causing the error in order to provide a more accurate solution.
阅读全文