|
@@ -4908,8 +4908,57 @@ window.Modernizr = function(n, e, t) {
|
|
|
.bind(this), this.goNext.bind(this))
|
|
|
}
|
|
|
,
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ n.prototype.findNearestItem = function(){//找到离currentPano最近的导览
|
|
|
+ var result = {item:[0,0], dis:Infinity};
|
|
|
+ var compare = (location, item)=>{
|
|
|
+ if(location.panoId != void 0 && location.panoId!= "outside"){
|
|
|
+ var pano = this.model.panos.index[location.panoId];
|
|
|
+ var dis = pano.position.distanceTo(this.player.currentPano.position)
|
|
|
+ if(dis<result.dis){
|
|
|
+ result.item = item, result.dis = dis
|
|
|
+ }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
|
|
|
+ /* if(this.itemCompare(item, this.currentItem, 'equal')){
|
|
|
+ result.item = item, result.dis = dis
|
|
|
+ } */
|
|
|
+ if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
|
|
|
+ result.item = item, result.dis = dis
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ this.model.heroLocations.forEach((e,i)=>{
|
|
|
+ if(e.heroLocations){
|
|
|
+ /* e.heroLocations.forEach((a,j)=>{
|
|
|
+ compare(a, [i,j])
|
|
|
+ }) */
|
|
|
+ var location = e.heroLocations.find(e=>e.panoId != void 0)
|
|
|
+ location && compare(location, [i,0])
|
|
|
+
|
|
|
+ }else{
|
|
|
+ compare(e, [i,0])
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ return result.item
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
n.prototype.playTour = function() {
|
|
|
- if (!this.bounceable()) {
|
|
|
+ if (!this.bounceable() && this.model.heroLocations.length) {
|
|
|
|
|
|
if(!this.currentItem) this.currentItem = []
|
|
|
if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
|
|
@@ -4951,6 +5000,34 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.goToDestination()) : this.goNext()))
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ n.prototype.playTourNearBy = function() {
|
|
|
+
|
|
|
+ if (!this.bounceable()){
|
|
|
+ return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
|
|
|
+ this.tourInProgress = !0,
|
|
|
+ this.reachSource = "play",
|
|
|
+ this.tourIsPlaying = !0,
|
|
|
+ this.wasZoomEnabled = this.player.zoomEnabled,
|
|
|
+ this.player.zoomEnabled = !1,
|
|
|
+ this.resetSpecialTransition(),
|
|
|
+ this.emit("update.controls"),
|
|
|
+ this.emit(p.TourStart),
|
|
|
+ this.player.enablePreRendering(),
|
|
|
+
|
|
|
+ /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
|
|
|
+ this.goToDestination()) : this.goNext())) */
|
|
|
+
|
|
|
+
|
|
|
+ this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
,
|
|
|
/* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
|
|
|
|
|
@@ -5144,7 +5221,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.setDestinationItem(item)
|
|
|
}
|
|
|
|
|
|
- if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
|
|
|
+ if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')){
|
|
|
this.useSpecialTransition("reverse-looping to end")
|
|
|
}else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
|
|
|
this.useSpecialTransition("looping back to start")
|
|
@@ -8947,6 +9024,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
function r() {
|
|
|
C.playTour(),
|
|
|
+ //C.playTourNearBy(),
|
|
|
I && clearTimeout(I),
|
|
|
d(),
|
|
|
_.removeClass("fadeIn")
|
|
@@ -23765,7 +23843,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
,
|
|
|
n.prototype.getCurrentNodePanos = function(e) {
|
|
|
this.model.panos.map;
|
|
|
- if (e.length = 0, this.path.nodes){
|
|
|
+ if (e.length = 0, this.path.nodes.length){
|
|
|
|
|
|
var momentTour = this.director.getMomentTour(this.director.destinationItem)
|
|
|
if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
|