Cesium将经纬度转为屏幕坐标系并判断是否在当前视角可见

//1.计算屏幕坐标
let position = Cesium.Cartesiian3.fromDegrees(jd, wd, 0);
let chanedc = Cesium.SceneTransforms.wgs84ToWindowCoordinates(viewer.scene, position);
if(chanedc == undefined) return;

//2.判断当前视角是否可见
let cameraOccluder = new Cesium.EllipsoidalOccluder(Cesium.Ellipsoid.WGS84, viewer.camera.position);
let viewerVisible = cameraOccluder.isPointVisible(position);

你可能感兴趣的:(Cesium,javascript)