From 35f2ecaac3760f4fffd1bb127b42fe1bd987240f Mon Sep 17 00:00:00 2001 From: gaozl Date: Tue, 23 May 2023 17:53:36 +0800 Subject: [PATCH 1/2] fix: ci --- public/static/qm/MainMap_QM.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) 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); From 6fb263bfb5b7d5788543a143655c078fe66fb90d Mon Sep 17 00:00:00 2001 From: gaozl Date: Wed, 24 May 2023 17:53:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=9B=BE=E6=A0=87=E5=BC=B9=E8=B7=B3?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/qm/MainMap_QM.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/public/static/qm/MainMap_QM.js b/public/static/qm/MainMap_QM.js index 2a98888..66a0729 100644 --- a/public/static/qm/MainMap_QM.js +++ b/public/static/qm/MainMap_QM.js @@ -1,4 +1,4 @@ -var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = false, shopTime, debug = false; //dir--自定义地图大小适应不同版本的地图大小 +var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = true, shopTime, debug = false; //dir--自定义地图大小适应不同版本的地图大小 //basePath 基础路径 graphPath最佳路径 ftPath 扶梯路径 dtPath 电梯路径 var typeObj = [{ ft: 0, type: 0, code: 'ft', name: '扶梯' }, { upft: 1, type: 1, code: 'upft', name: '上扶梯' }, { downft: 2, type: 2, code: 'downft', name: '下扶梯' }, { mys: 3, type: 3, code: 'mys', name: '母婴室' }, { xsj: 4, type: 4, code: 'xsj', name: '洗手间' }, @@ -2166,10 +2166,6 @@ MainMap_QM.prototype = { Map_QM.mapArr[t][i].labelObj.traverse((obj) => { obj.visible = false; }); - Map_QM.mapArr[t][i].iconLabel.traverse((obj) => { - obj.visible = false; - }); - Map_QM.mapArr[t][i].tagObj.traverse((obj) => { obj.visible = false; }); @@ -2190,9 +2186,6 @@ MainMap_QM.prototype = { Map_QM.mapArr[build][i].labelObj.traverse((obj) => { obj.visible = true; }); - Map_QM.mapArr[build][i].iconLabel.traverse((obj) => { - obj.visible = true; - }); Map_QM.mapArr[build][i].showTagObj.traverse((obj) => { obj.visible = true; }); @@ -3500,7 +3493,7 @@ MainMap_QM.prototype = { */ /** - * @api {方法} bounceIcon({type:"xsj"}) 图标弹跳 + * @api {方法} bounceIcon("xsj") 图标弹跳 * @apiGroup 地图导航 * @apiDescription 地图图标弹跳效果 * @apiVersion 4.0.0 @@ -3510,7 +3503,7 @@ MainMap_QM.prototype = { * * @apiParamExample {String} 请求示例 * - * Map_QM.bounceIcon({type:"xsj"}); + * Map_QM.bounceIcon("xsj"); * */ bounceIcon: function (iconType) { @@ -5121,9 +5114,6 @@ FloorMap_QM = function (bIndex, fIndex, floorName) { this.allObj.rotation.x = Math.PI / -2; this.labelObj = new THREE.Group(); this.labelObj.renderOrder = 100; - this.iconLabel = new THREE.Group(); - this.iconLabel.renderOrder = 100; - this.floorOrder = fIndex; this.buildOrder = bIndex this.floorName = floorName; @@ -5145,7 +5135,6 @@ FloorMap_QM = function (bIndex, fIndex, floorName) { this.allObj.add(this.serObj); this.allObj.add(this.devObj); this.allObj.add(this.labelObj); - this.allObj.add(this.iconLabel); this.allObj.add(this.tagObj); //标签 this.showTagObj = new THREE.Group(); @@ -6251,7 +6240,8 @@ Facilities_QM = function () { shopDiv.dataset.nameEn = Map_QM.util.iconEn[obj.title]; let shopLabel = new THREE.CSS2DObject(shopDiv); shopLabel.position.set(obj.x, -1 * obj.y, 30); - _this.iconLabel.add(shopLabel); + shopLabel.userData.mapShow = true; + _this.labelObj.add(shopLabel); } } }