瀏覽代碼

Merge branch 'master' of http://121.42.8.157:13000/zengminguo/D-MAP

leihao 11 月之前
父節點
當前提交
7e5de7ffda
共有 2 個文件被更改,包括 26 次插入7 次删除
  1. 22 3
      src/store/modules/common/mutations.js
  2. 4 4
      src/views/ordinaryPage/index.less

+ 22 - 3
src/store/modules/common/mutations.js

@@ -94,19 +94,38 @@ export default {
         window.sdkInstance.changeMode('panorama');
         let player = document.getElementById('player')
         player.appendChild(element)
-      }, 500)
+        element.style.width = window.innderWidth+'px';
+        element.style.height = window.innderHeight+'px';
+        window.renderWidth = window.innderWidth;
+        window.renderHeight = window.innderHeight;
+        element.width = (window.innderWidth * 2);
+        element.height = (window.innderHeight * 2);
+        element.style.marginLeft = '0px';
+        element.style.marginTop = '0px';
+      })
       sessionStorage.setItem('3dMode', 1)
     } else {
       setTimeout(() => {
-        window.sdkInstance.changeMode('floorplan');
+        
         let mapDom = document.getElementsByClassName("ordinary-map-container")[0];
           let style = getComputedStyle(mapDom);
           let width = parseFloat(style.width);
           let height = parseFloat(style.height);
+        window.renderWidth = width * 1.8;
+        window.renderHeight = height * 1.8;
         window.sdkInstance.sceneRenderer.updateScreenSize(width, height);
+        element.width = (width * 2) * 1.8;
+        element.height = (height * 2) * 1.8;
+        element.style.width = (width * 1.8)+'px';
+        element.style.height = (height * 1.8)+'px';
+        element.style.marginLeft = ((width - (width * 1.8)) / 2) + 'px';
+        element.style.marginTop = ((height - (height * 1.8)) / 2) + 'px';
         let playersmall = document.getElementById('playersmall')
         playersmall.appendChild(element)
-      }, 500)
+        setTimeout(() => {
+          window.sdkInstance.changeMode('floorplan');
+        })
+      })
       sessionStorage.setItem('3dMode', 0)
     }
     

+ 4 - 4
src/views/ordinaryPage/index.less

@@ -85,12 +85,12 @@
       .ordinary-map {
         position: absolute;
         // opacity: 0;
-        width: 130vw;
-        height: 130vh;
+        // width: 130vw;
+        // height: 130vh;
         z-index: 0;
         border-radius: 40px;
-        margin-left: -35vw;
-        margin-top: -31vh;
+        // margin-left: -35vw;
+        // margin-top: -31vh;
 
         img {
           width: 100%;