当前位置:网站首页>cesium 监听地图缩放或放大来控制地图上添加的内容是否展示
cesium 监听地图缩放或放大来控制地图上添加的内容是否展示
2022-08-10 05:31:00 【怎么吃不饱捏】
根据视角高度来控制实体显示与隐藏,具体效果如下:

主要代码如下:
// 监听地图缩放或放大来控制地图上添加的内容是否展示
controlVisible() {
viewer.camera.changed.addEventListener(function() {
//视角改动监控
var currentMagnitude = viewer.camera.getMagnitude();
if (currentMagnitude > 13000000) {
for (let i = 0; i < viewer.entities.values.length; i++) {
viewer.entities.values[i].show = false;
}
} else {
for (let i = 0; i < viewer.entities.values.length; i++) {
viewer.entities.values[i].show = true;
}
}
});
},
边栏推荐
猜你喜欢

网安超基础一周目

Buu Web

如何在报表控件FastReport.NET中连接XLSX 文件作为数据源?

Depth of carding: prevent model fitting method

实战小技巧19:List转Map List的几种姿势

基于Servlet的验证码登陆demo

基于Qiskit——《量子计算编程实战》读书笔记(二)

Matlab simulation of multi-factor house price prediction based on BP neural network

pytorch框架学习(4)torchvision模块&训练一个简单的自己的CNN (一)

深度学习模型训练前的必做工作:总览模型信息
随机推荐
MySql之json_extract函数处理json字段
OAuth2 usage scenarios, common misunderstandings, use cases
Talk about API Management - Open Source Edition to SaaS Edition
SEO搜索引擎优化
网安超基础一周目
PCL,VS配置过程中出现:用 _sopen_s 代替 _open, 或用_CRT_SECURE_NO_WARNNINGS错误
Linear Algebra (4)
网络安全7
YOLOv5 PyQt5(一起制作YOLOv5的GUI界面)
Become a language that hackers have to learn. Do you think it's okay after reading it?
Get started with the OAuth protocol easily with a case
pytorch框架学习(7) tensorboard使用
【格式转换】将JPEG图片批量处理为jpg格式
pygame学习计划(1)
latex图片排版技巧总结
What are the common commands of mysql
【Pei Shu Theorem】CF1055C Lucky Days
AVL tree insertion--rotation notes
安装Robotics-toolbox-matlab, for 点云坐标系转换
OpenGauss source code, is it maintained with VSCode in the window system?