xzw hai 1 mes
pai
achega
07a5d3b1c3

+ 1 - 1
src/custom/modules/panos/Images360.js

@@ -1579,7 +1579,7 @@ export class Images360 extends THREE.EventDispatcher{
         if(i>-1){
             this.panos.splice(i,1)
             this.currentPano == pano && (this.currentPano = null) 
-            pano.dispatchEvent('dispose')
+            pano.dispose()
         }
     }                                    
                                       

+ 7 - 7
src/custom/modules/panos/Panorama.js

@@ -403,12 +403,17 @@ class Panorama extends THREE.EventDispatcher{
     }
     
  
-    
+    dispose(){
+        this.dispatchEvent('dispose')
+        this.marker.parent.remove(this.marker);
+        this.label && this.label.parent.remove(this.label);
+        this.label2 && this.label2.parent.remove(this.label2);
+    }
 
     
     
     addLabel(){ 
-        this.removeTextLabel()
+        this.label && this.label.parent.remove(this.label);
         this.label = new TextSprite(Object.assign({},
            labelProp, {text: this.id + "("+this.originID+")"}) //{text: `id:${this.id}, dataset:${this.pointcloud.name}, 4dkkId:${this.originID}`}
         ); 
@@ -429,11 +434,6 @@ class Panorama extends THREE.EventDispatcher{
     }
      
     
-    removeTextLabel(){
-        if(this.label){ 
-            this.label.parent.remove(this.label);
-        }
-    }