zhouenguang 3 лет назад
Родитель
Сommit
f58c535eaf
1 измененных файлов с 47 добавлено и 46 удалено
  1. 47 46
      js/main_2020_show.js

+ 47 - 46
js/main_2020_show.js

@@ -4534,22 +4534,22 @@ window.Modernizr = function(n, e, t) {
                 this.updateModel(),
                 this.resetAll(),
                 this.bindEvents()
-                // zeg 查询pano对应的导览片段
-                if(!this.panoIdMap) {
-                    this.panoIdMap = new Map()
-                    this.model.heroLocations.forEach( (value, index) => {
-                        // value.heroLocations.forEach( hl => {
-                            if(!value.heroLocations) return
-                            let hl = value.heroLocations[0]
-                            let arr = this.panoIdMap.get(hl.panoId)
-                            if(arr){
-                                this.panoIdMap.set(hl.panoId, [...arr, index])
-                            } else {
-                                this.panoIdMap.set(hl.panoId, [index])
-                            }
-                        // })
-                    })
-                }
+                // // zeg 查询pano对应的导览片段
+                // if(!this.panoIdMap) {
+                //     this.panoIdMap = new Map()
+                //     this.model.heroLocations.forEach( (value, index) => {
+                //         // value.heroLocations.forEach( hl => {
+                //             if(!value.heroLocations) return
+                //             let hl = value.heroLocations[0]
+                //             let arr = this.panoIdMap.get(hl.panoId)
+                //             if(arr){
+                //                 this.panoIdMap.set(hl.panoId, [...arr, index])
+                //             } else {
+                //                 this.panoIdMap.set(hl.panoId, [index])
+                //             }
+                //         // })
+                //     })
+                // }
             }
             ,
             n.prototype.resetAll = function() {
@@ -4960,30 +4960,31 @@ window.Modernizr = function(n, e, t) {
             n.prototype.playTour = function() {
                 if (!this.bounceable() && this.model.heroLocations.length) {
 
-                    if(!this.currentItem) this.currentItem = []
-                    if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
-                        // zeg 从当前pano进行自动导览
-                        let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
-                        // this.model.heroLocations.forEach( (value, index) => {
-                            // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
-                            //     currentPanoDestinations.push(index)
-                            // }
-                        // })
+                    // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
+                    // if(!this.currentItem) this.currentItem = []
+                    // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
+                    //     // zeg 从当前pano进行自动导览
+                    //     let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
+                    //     // this.model.heroLocations.forEach( (value, index) => {
+                    //         // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
+                    //         //     currentPanoDestinations.push(index)
+                    //         // }
+                    //     // })
 
-                        if(!currentPanoDestinations) { 
-                            // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
-                            let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
-                            let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
-                            for(var i = 0; i < neighbourIndex.length; i++) {
-                                currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
-                                if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
-                            }
-                            if(!currentPanoDestinations) currentPanoDestinations = [0];
-                        }
-                        if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
-                            this.currentItem[0] = currentPanoDestinations[0]
-                        }
-                    }
+                    //     if(!currentPanoDestinations) { 
+                    //         // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
+                    //         let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
+                    //         let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
+                    //         for(var i = 0; i < neighbourIndex.length; i++) {
+                    //             currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
+                    //             if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
+                    //         }
+                    //         if(!currentPanoDestinations) currentPanoDestinations = [0];
+                    //     }
+                    //     if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
+                    //         this.currentItem[0] = currentPanoDestinations[0]
+                    //     }
+                    // }
 
                     return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
                     this.tourInProgress = !0,
@@ -4995,7 +4996,7 @@ window.Modernizr = function(n, e, t) {
                     this.emit("update.controls"),
                     this.emit(p.TourStart),
                     this.player.enablePreRendering(),
-                    this.currentItem[1] = null,
+                    // this.currentItem[1] = null,
                     this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
                     this.goToDestination()) : this.goNext()))
                 }
@@ -5200,15 +5201,15 @@ window.Modernizr = function(n, e, t) {
                 
                 A.debug("tourAdvance(" + e + ")") 
 
-                // zeg改
+                // // zeg改
                 if(null === this.currentItem || void 0 === this.currentItem){
                     // this.setDestinationItem(this.firstDestination()) 
                     // this.setDestinationItem([currentPanoDestinations[0], 0]) 
                     this.setDestinationItem([this.currentItem[0], 0]) 
                 }
-                else if(this.currentItem[1] == null) {
-                    this.setDestinationItem([this.currentItem[0], 0])
-                }
+                // else if(this.currentItem[1] == null) {
+                //     this.setDestinationItem([this.currentItem[0], 0])
+                // }
                 else{ 
                     
                         var item    
@@ -9023,8 +9024,8 @@ window.Modernizr = function(n, e, t) {
             })
         }
         function r() {
-            C.playTour(),
-            //C.playTourNearBy(),
+            // C.playTour(),
+            C.playTourNearBy(),
             I && clearTimeout(I),
             d(),
             _.removeClass("fadeIn")