在Cesium中,默认会对场景中添加的entity进行双击追踪效果(类似Unity中的选中物体后按F),参考
Remove default double click behavior in Cesium – http://webiks.com/remove-default-double-click-behavior-in-cesium/
这篇文章中介绍的方法后,发现所谓的”less intrusive way”并不好用,双击选中后的摄像机移动逻辑还是触发了,于是最终采用了第一种解决方法:
1 | viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); |
实测在1.48版中可以达到效果,另外伴随这个默认双击追踪实体行为的,还有个默认的选中指示框,这个可以通过在new Cesium.Viewer的时候指定selectionIndicator: false来关闭,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | var viewer = new Cesium.Viewer( 'cesiumContainer' , { 'timeline' : false , 'animation' : false , 'homeButton' : false , 'geocoder' : false , 'fullscreenButton' : false , 'searchButton' : false , 'scene3DOnly' : false , 'terrainShadows' : Cesium.ShadowMode.DISABLED, 'navigationHelpButton' : false , 'selectionIndicator' : false , 'sceneModePicker' : false , 'infoBox' : false , 'baseLayerPicker' : false , 'shadows' : false , }); |