|
@@ -4534,6 +4534,21 @@ window.Modernizr = function(n, e, t) {
|
|
this.updateModel(),
|
|
this.updateModel(),
|
|
this.resetAll(),
|
|
this.resetAll(),
|
|
this.bindEvents()
|
|
this.bindEvents()
|
|
|
|
+
|
|
|
|
+ // 周恩光 查询pano对应的导览片段
|
|
|
|
+ if(!this.panoIdMap) {
|
|
|
|
+ this.panoIdMap = new Map()
|
|
|
|
+ this.model.heroLocations.forEach( (value, index) => {
|
|
|
|
+ value.heroLocations.forEach( hl => {
|
|
|
|
+ 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() {
|
|
n.prototype.resetAll = function() {
|
|
@@ -5069,13 +5084,23 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
A.debug("tourAdvance(" + e + ")")
|
|
A.debug("tourAdvance(" + e + ")")
|
|
// 周恩光加 从当前pano进行自动导览
|
|
// 周恩光加 从当前pano进行自动导览
|
|
- let currentPanoDestinations = []
|
|
|
|
- this.model.heroLocations.forEach( (value, index) => {
|
|
|
|
- if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
|
|
|
|
- currentPanoDestinations.push(index)
|
|
|
|
|
|
+ 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 neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2 ]
|
|
|
|
+ for(var i = 0; i < neighbourIndex.length; i++) {
|
|
|
|
+ currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]].id)
|
|
|
|
+ if(currentPanoDestinations) break
|
|
}
|
|
}
|
|
- })
|
|
|
|
- if(!currentPanoDestinations[0]) { currentPanoDestinations.push(0) }
|
|
|
|
|
|
+ if(!currentPanoDestinations)
|
|
|
|
+ currentPanoDestinations.push(0)
|
|
|
|
+ }
|
|
|
|
|
|
if(null === this.currentItem || void 0 === this.currentItem){
|
|
if(null === this.currentItem || void 0 === this.currentItem){
|
|
// this.setDestinationItem(this.firstDestination())
|
|
// this.setDestinationItem(this.firstDestination())
|