|
@@ -1443,10 +1443,27 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ deletePano(pano){
|
|
|
|
|
+ let i = this.panos.indexOf(pano)
|
|
|
|
|
+ if(i>-1){
|
|
|
|
|
+ this.panos.splice(i,1)
|
|
|
|
|
+ pano.dispatchEvent('dispose')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ addPano(info){
|
|
|
|
|
+
|
|
|
|
|
+ info.id = this.panos.length //把info的id的一长串数字改简单点
|
|
|
|
|
+
|
|
|
|
|
+ let pano = new Panorama( info, this );
|
|
|
|
|
+
|
|
|
|
|
+ pano.addEventListener('dispose',(e)=>{
|
|
|
|
|
+ if(this.closestPano == pano) this.closestPano = null
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ this.panos.push(pano);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
addPanoData(data={} ){//加载漫游点
|
|
addPanoData(data={} ){//加载漫游点
|
|
@@ -1455,17 +1472,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
if(!data || data.length == 0)return console.error( '没有漫游点')
|
|
if(!data || data.length == 0)return console.error( '没有漫游点')
|
|
|
|
|
|
|
|
data.forEach((info)=>{
|
|
data.forEach((info)=>{
|
|
|
- //if(Potree.fileServer){
|
|
|
|
|
- info.id = this.panos.length //把info的id的一长串数字改简单点
|
|
|
|
|
- //}
|
|
|
|
|
- let pano = new Panorama( info, this );
|
|
|
|
|
-
|
|
|
|
|
- pano.addEventListener('dispose',(e)=>{
|
|
|
|
|
- if(this.closestPano == pano) this.closestPano = null
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- this.panos.push(pano);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ addPano(info)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|