diff --git a/public/static/qm/MainMap_QM.js b/public/static/qm/MainMap_QM.js index 0130780..2a98888 100644 --- a/public/static/qm/MainMap_QM.js +++ b/public/static/qm/MainMap_QM.js @@ -65,7 +65,7 @@ QMUtil = function () { g_col: "#ffffff", a_int: 0.5 }; - this.m_zoom = 1.2; + this.m_zoom = 1.2; //2D地图缩放大小 this._clock = new THREE.Clock(); this._indexPathFloor = 0; // 遍历途径数据 this.changeDist = { inner: 350, outner: 900 }; //室内外切换的极限值, 如果 inner小于minDis 则不支持缩放切换 @@ -2026,6 +2026,7 @@ MainMap_QM.prototype = { Map_QM.controls.object = Map_QM.camera; Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; Map_QM.controls.maxPolarAngle = Math.PI / 2 - 0.2; + Map_QM.controls.setZoom(1); Map_QM.camera.updateProjectionMatrix(); //必须update Map_QM.camera.position.set(Map_QM.util.guiOptions.cameraX, Map_QM.util.guiOptions.cameraY, Map_QM.util.guiOptions.cameraZ); Map_QM.changeIconState(state); @@ -2323,15 +2324,7 @@ MainMap_QM.prototype = { if (Map_QM.util.initModelArr.length > 0 && Map_QM.util.changeDist.inner > Map_QM.util.options.minDis) { Map_QM.controls.maxDistance = Map_QM.util.changeDist.inner; } - if (Map_QM.camera == Map_QM.cameraOrtho) { - Map_QM.util.setModelState('3d') - Map_QM.camera = Map_QM.cameraPerspective - Map_QM.controls.setZoom(zoom) - Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; - Map_QM.controls.object = Map_QM.camera - Map_QM.controls.enabled = true - Map_QM.controls.enableRotate = true - } + Map_QM.controls.setZoom(zoom) let vat = Map_QM.mapBackToWorld(centerPoint.x, centerPoint.y, 0); TweenMax.to(Map_QM.controls.object.position, 0.1, { x: vat.x, delay: 0.1, onComplete: function () { @@ -2362,6 +2355,7 @@ MainMap_QM.prototype = { * */ onShowDeviceSite: function () { + this.changeMapModel("3D"); this.showFloor(this.util.deviceObj.floor); }, /** @@ -2855,7 +2849,7 @@ MainMap_QM.prototype = { Map_QM.controls.update(); Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); - if(Map_QM.mapArr[Map_QM.util.selectBuild]){ + if(Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]){ Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj, Map_QM.camera ); Map_QM.labelRenderer.renderObject( Map_QM.CSSObject, Map_QM.camera ); } @@ -3326,6 +3320,7 @@ MainMap_QM.prototype = { shopTime = setTimeout(() => { clearTimeout(shopTime); isJUZ = false; + Map_QM.controls.setZoom(1) Map_QM.controls.reset() }, 3000); } @@ -3420,12 +3415,10 @@ MainMap_QM.prototype = { //内部碰撞检测 collLabel: function () { - if (!Map_QM) { - return; - } - if (!Map_QM.util.options.collision) { + if (!Map_QM || !Map_QM.util.options.collision) { return; } + clearTimeout(Map_QM.util.timeObj.collTime); Map_QM.util.timeObj.collTime = setTimeout(() => { clearTimeout(Map_QM.util.timeObj.collTime); @@ -4826,6 +4819,7 @@ MainMap_QM.prototype = { */ clearFloor: function (fIndex = -1, reSet = true) { isJUZ = false; + Map_QM.controls.setZoom(1) if (fIndex == -1) { fIndex = Map_QM.util.deviceObj.floor; } @@ -6027,7 +6021,6 @@ MyModel_QM.prototype.MyModelShape = function (areaArr, howllowArr, opObj, entity } // 创建模型 let mesh = new THREE.Mesh(scanGeometry, meshMaterial); - if (!Map_QM.util.toMapModel && opObj.type != "wall") { let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); let cubeLine = new THREE.LineSegments(cubeEdges, material);