xzw пре 2 година
родитељ
комит
4d65a27eb3

+ 12 - 2
src/custom/modules/panos/Images360.js

@@ -632,14 +632,24 @@ export class Images360 extends THREE.EventDispatcher{
         //Potree.Log('hope flyToPano: '+toPano.pano.id )
         
         
-        if(this.latestToPano && this.latestToPano != toPano && this.latestToPano.pano != this.currentPano){//还在飞//如果旧的toPano只是旋转镜头,就直接取消旧的
+       
+        //如果旧的toPano只是旋转镜头,就直接取消旧的
+        
+        
+        
+        if(this.latestToPano && this.latestToPano != toPano && (//还在飞
+            this.latestToPano.pano != this.currentPano || !this.isAtPano())){//如果旧的toPano只在pano旋转镜头,就直接取消旧的,继续执行 
             return done(false) 
         }
-        //Potree.Log('flyToPano: '+toPano.pano.id,  this.latestToPano && this.latestToPano.pano.id )
+         
         if(this.currentPano == toPano.pano && this.isAtPano() && !toPano.target && !toPano.quaternion  ){
+            //已在该pano
             this.dispatchEvent({type:'flyToPano', toPano})
             return done(true);
         }
+     
+        //Potree.Log('flyToPano: '+toPano.pano.id,  this.latestToPano && this.latestToPano.pano.id )
+        
         
         let target = toPano.target   
         let config = Potree.config.displayMode[Potree.settings.displayMode]

+ 2 - 0
src/custom/objects/tool/MeasuringTool.js

@@ -623,6 +623,8 @@ export class MeasuringTool extends THREE.EventDispatcher{
             this.viewer.removeEventListener('global_touchstart', click )//add  importance
             measure.dispatchEvent('firstClick')
             
+            
+            measure.beginAddTime = Date.now()
             //console.log('measure clicked')
             e.consume && e.consume()
             

+ 2 - 0
src/custom/objects/tool/ctrlPolygon.js

@@ -451,6 +451,8 @@ export class ctrlPolygon extends THREE.Object3D {
                 || !e.isAtDomElement && this.isNew//如果是刚添加时在其他dom点击, 不要响应
                 ||  e.hoverViewport != viewer.mainViewport && this.unableDragAtMap //垂直的测量线不允许在地图上放点
                 || this.isNew && !getDifferentPoint(this.points, this.points.length )   //不允许和之前的点相同, 但这句在点云稀疏时会导致难结束 
+                || this.isNew && (Date.now() - this.beginAddTime) < Potree.config.clickMaxPressTime && e.pressDistance < Potree.config.clickMaxDragDis/* &&  e.pressTime<Potree.config.clickMaxPressTime */  //有的设备过于灵敏,点击一下就结束测量了,是因为滑动了被判断为拖拽。所以判断下如果滑动距离过近不时间过短就算单击
+     
             ) 
         ){
             return this.continueDrag(null,e)    

+ 1 - 0
src/navigation/InputHandlerNew.js

@@ -582,6 +582,7 @@ export class InputHandler extends THREE.EventDispatcher {
                     {
                         type: 'drop',
                         pressDistance, 
+                        pressTime
                     }
                 ));