首页 / 浏览问题 / WebGIS / 问题详情
如何关闭entity的双击的相机跟踪
46EXP 2021年12月22日

使用产品:webGL 操作系统:win10 x64
数据类型: 文件型
问题详细描述:双击entity会设置viewer的相机跟随trackedEntity功能。如何设置不允许双击entity打开相机跟随。

遇到的问题:在同时使用entity和开挖效果时。开挖过后,再双击entity,相机视角会失控并不能鼠标操作复原。

1. entity使用方法:

viewer.entities.add({
                    position : Cesium.Cartesian3.fromDegrees(parseFloat(selectedFeatures[i].fieldValues["12"]),parseFloat(selectedFeatures[i].fieldValues["13"]),parseFloat(selectedFeatures[i].fieldValues["16"])),
                    billboard :{
                        image : './images/location4.png',
                        width:30,
                        height:40,
                        
                    },
                    name : selectedFeatures[i].fieldValues["11"],
                    description: des
                });

2. 开挖使用方法:viewer.scene.globe.addExcavationRegion   及  s3mlayer的  viewer.scene.layers[0].addExcavationRegion

1个回答

你好,可以这样设置:

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function(movement) {
    viewer.trackedEntity = undefined;
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
6,077EXP 2021年12月22日
解决了。多谢。
...