function removedata() { viewer.destroyprimitives=false viewer.scene.primitives.remove(palaceTileset); } var y3 = document.getElementById("dataremove"); y3.onclick = function () { removedata() }
时间: 2023-06-27 09:01:51 浏览: 40
这是一段 JavaScript 代码。它定义了一个名为 "removedata" 的函数,该函数将 "viewer.destroyprimitives" 设置为 false,并从 "viewer.scene.primitives" 中删除 "palaceTileset"。然后,它使用文档对象模型(DOM)获取一个名为 "dataremove" 的元素,并将其 "onclick" 事件处理程序设置为调用 "removedata" 函数。这意味着当用户单击具有 "dataremove" ID 的元素时,将调用 "removedata" 函数。
相关问题
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.
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 来进行更可靠的操作。
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)