当前位置:网站首页>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;
}
}
});
},
边栏推荐
- Attention candidates for the soft exam! The detailed registration process for the second half of 2022 is coming!
- AVL tree insertion--rotation notes
- Kubernetes:(十七)Helm概述、安装及配置
- 聊聊 API 管理-开源版 到 SaaS 版
- 【Pei Shu Theorem】CF1055C Lucky Days
- Zhongang Mining: Strong downstream demand for fluorite
- canvas canvas drawing clock
- AWR1843型号毫米波雷达使用
- SSM框架整合实例
- 深度学习中的学习率调整策略(1)
猜你喜欢
大咖说·对话生态|当Confluent遇见云:实时流动的数据更有价值
[Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation
Become a language that hackers have to learn. Do you think it's okay after reading it?
一篇文章带你搞懂什么是幂等性问题?如何解决幂等性问题?
深度学习中数据到底要不要归一化?实测数据来说明!
非会员更改有道云笔记背景
Jenkins 如何玩转接口自动化测试?
Pony语言学习(九)——泛型与模式匹配(终章)
【Pei Shu Theorem】CF1055C Lucky Days
细数国产接口协作平台的六把武器!
随机推荐
Read the excerpt notes made by dozens of lightweight target detection papers for literacy
OAuth2 usage scenarios, common misunderstandings, use cases
OpenGauss source code, is it maintained with VSCode in the window system?
pytorch框架学习(9)torchvision.transform
Qiskit学习笔记(三)
Error when installing oracle rac 11g and executing root.sh
关于cfar检测的学习及仿真
深度学习模型训练前的必做工作:总览模型信息
Matlab simulation of multi-factor house price prediction based on BP neural network
pytorch框架学习(5)torchvision模块&训练一个简单的自己的CNN (二)
基于Qiskit——《量子计算编程实战》读书笔记(七)
网络安全7
.las转.txt 再转.pcd,编译运行中出现的错误
PCL点云配准--ICP or keypoints+features
CORS跨域资源共享漏洞的原理与挖掘方法
scikit-learn机器学习 读书笔记(二)
R简单统计计算--笔记
基于Qiskit——《量子计算编程实战》读书笔记(六)
Conda creates a virtual environment method and pqi uses a domestic mirror source to install a third-party library method tutorial
pytorch框架学习(3)torch.nn.functional模块和nn.Module模块