xzw 3 years ago
parent
commit
c76e29daea
3 changed files with 35 additions and 66 deletions
  1. 0 48
      edit.html
  2. 14 17
      index.html
  3. 21 1
      js/main_2020_show.js

+ 0 - 48
edit.html

@@ -1794,54 +1794,6 @@
         */
 
 
-        var log = window.location.href.substring(window.location.href.indexOf("?") + 1).indexOf('log') > -1;
-
-        if (log) {
-            var textarea = document.createElement('textarea');
-            textarea.id = "consoleLog";
-            textarea.style.width = "120px";
-            textarea.style.height = "150px";
-            textarea.style.position = "absolute";
-            textarea.style.left = "0px";
-            textarea.style.bottom = "100px";
-            textarea.style['z-index'] = "100";
-            textarea.style['font-size'] = "14px";
-            textarea.style.color = "black";
-            document.getElementsByTagName("body")[0].appendChild(textarea);
-            console.oldLog = console.log;
-            console.log = function (str) {
-                console.oldLog(str);
-                var t = document.getElementById("consoleLog").innerHTML;
-                document.getElementById("consoleLog").innerHTML = str + "\n" + t;
-            }
-
-            console.olderror = console.error;
-            console.error = function (str) {
-                console.olderror(str);
-                var t = document.getElementById("consoleLog").innerHTML;
-                document.getElementById("consoleLog").innerHTML = str + "\n" + t;
-            }
-
-            console.oldwarn = console.warn;
-            console.warn = function (str) {
-                console.oldwarn(str);
-                var t = document.getElementById("consoleLog").innerHTML;
-                document.getElementById("consoleLog").innerHTML = str + "\n" + t;
-            }
-
-            console.olddebug = console.debug;
-            console.debug = function (str) {
-                console.olddebug(str);
-                var t = document.getElementById("consoleLog").innerHTML;
-                document.getElementById("consoleLog").innerHTML = str + "\n" + t;
-            }
-
-            console.oldinfo = console.info;
-            console.info = function (str) {
-                console.oldinfo(str);
-                document.getElementById("consoleLog").innerHTML += str + "\n";
-            }
-        }
     </script>
 
     <script src="js/lib/jquery-2.1.1.min.js" class="build keep"></script>

+ 14 - 17
index.html

@@ -795,23 +795,20 @@
         var changeLog = ()=>{
         
             if(number == "TEST" && browser.isMobile()){
-                var textarea = document.createElement('textarea');
-                  textarea.id = "consoleLog";
-
-                  document.getElementsByTagName("body")[0].appendChild(textarea);
-                  var list = ["log", "error", "warn", "debug", "info", "time", "timeEnd"]
-                  var exchange = function (o) {
-                    console["old" + o] = console[o];
-                    console[o] = function (str) {
-                      console["old" + o](str);
-                      var t = document.getElementById("consoleLog").innerHTML;
-                      document.getElementById("consoleLog").innerHTML = str + "\n\n" + t;
-                    }
-                  }
-
-                  for (var i = 0; i < list.length; i++) {
-                    exchange(list[i])
-                  } 
+                var exchange = function (o) {
+                console["old" + o] = console[o];
+                console[o] = function () {
+                  var args =   Array.from(arguments)
+                  console["old" + o].apply(this, arguments)
+                  var t = document.getElementById("consoleLog").innerHTML;
+                  
+                  var str = ''
+                  args.forEach(a=>{
+                      str += a
+                  })
+                  document.getElementById("consoleLog").innerHTML = str + "\n\n" + t;
+                }
+              }
            
             }
             

+ 21 - 1
js/main_2020_show.js

@@ -18969,6 +18969,7 @@ window.Modernizr = function(n, e, t) {
                             }
                             t[this.id] || (t[this.id] = !0,
                             this.on(f.LoadComplete, function(e, t) {
+                                //console.warn('点位下载完成 ', 'id:'+this.id,  'count:'+t )
                                 var i = this.getWaitDeferred(e).deferred;
                                 i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
                                 this.resetWaitDeferred(e))
@@ -18981,6 +18982,9 @@ window.Modernizr = function(n, e, t) {
                             }
                             .bind(this)),
                             this.on(f.TileLoaded, function(t, i, n) {
+                                //console.log('tileLoaded', 'id:'+this.id,  'size:'+t, 'index:'+i )
+
+
                                 var r = this.getWaitDeferred(t).deferred;
                                 if (r && "pending" === r.state()) {
                                     r.notify(t, i, n);
@@ -27492,6 +27496,10 @@ window.Modernizr = function(n, e, t) {
             var e = {}
               , t = (new h.Vector4,
             d.tiling.overlayStyle);
+
+            //var failHistory = {};
+
+
             return function(i, n) {
                 var r = i.panoId
                   , o = i.image
@@ -27519,6 +27527,14 @@ window.Modernizr = function(n, e, t) {
                 this.isTileUploaded(i) && (p = !1,
                 g = !1)),
                 p) {
+
+                    /* if(failHistory[''+r+s+l]){
+                        console.log('uploadTile retry', r, s, l)
+                    }
+
+                    console.log('uploadTile  成功', r, s, l)
+                     */
+                    
                     var C = u * a
                       , I = d * a
                       , E = a / s * y
@@ -27538,8 +27554,12 @@ window.Modernizr = function(n, e, t) {
                     m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
                     this.setUploaded(i, !0),
                     this.addCoverageForNode(i.node)
-                } else
+                } else{
                     this.setUploaded(i, !1);
+                    console.log('uploadTile  失败', r, s, l)
+                    //failHistory[''+r+s+l] = true;
+
+                }
                 return i.uploadAttempted || (m.uploadAttempts++,
                 this.emit(f.TileUploadAttempted, r, s, l, c)),
                 i.uploadAttempted = !0,