From da6a21e4a216c41a890dfdc8907d88d2c6033950 Mon Sep 17 00:00:00 2001 From: zhangyao Date: Sat, 17 Jun 2023 16:02:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A7=A9=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=A7=92=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/offline/JSON/GetDevCoordinateByIP.json | 2 +- public/static/qm/MainMap_QM.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/public/static/offline/JSON/GetDevCoordinateByIP.json b/public/static/offline/JSON/GetDevCoordinateByIP.json index 7b56bba..4d8fc37 100644 --- a/public/static/offline/JSON/GetDevCoordinateByIP.json +++ b/public/static/offline/JSON/GetDevCoordinateByIP.json @@ -16,7 +16,7 @@ "ip": "192.168.1.209", "mac": "4CEDFBCAFF27", "location": "30", - "angle": "0", + "angle": "90", "projectCode": "project-n-ww5jvpwnu0ads70lbkda" } } diff --git a/public/static/qm/MainMap_QM.js b/public/static/qm/MainMap_QM.js index c2dfc40..78fb1ed 100644 --- a/public/static/qm/MainMap_QM.js +++ b/public/static/qm/MainMap_QM.js @@ -1921,6 +1921,8 @@ MainMap_QM.prototype = { */ changeMapState: function (state) { Map_QM.controls.reset(); + let angle = Map_QM.util.options.deviceAng ? Map_QM.util.deviceObj.angle : Map_QM.util.mapAngle + Map_QM.rotationAngle(angle) if (state === "3d") { Map_QM.camera = Map_QM.cameraPerspective; Map_QM.controls.object = Map_QM.camera; @@ -2184,6 +2186,8 @@ MainMap_QM.prototype = { Map_QM.controls.object = Map_QM.camera; Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; Map_QM.controls.reset(); + let angle = Map_QM.util.options.deviceAng ? Map_QM.util.deviceObj.angle : Map_QM.util.mapAngle + Map_QM.rotationAngle(angle) } }, @@ -2269,6 +2273,8 @@ MainMap_QM.prototype = { this.controls.maxAzimuthAngle = Infinity; this.shawLight.castShadow = this.util.options.shadow; this.controls.reset(); + let angle = this.util.options.deviceAng ? this.util.deviceObj.angle : this.util.mapAngle + this.rotationAngle(angle) }, /** * @api {方法} changePathDir(pathState) 切换导航方向 @@ -2640,7 +2646,9 @@ MainMap_QM.prototype = { * */ rotationAngle: function (angle) { - Map_QM.controls.setRotateHorizontal(angle / 180 * Math.PI); + if(Math.abs(parseInt(angle)+Map_QM.controls.getRotateHorizontal()*180/Math.PI)>5){ + Map_QM.controls.setRotateHorizontal((angle / 180) * Math.PI) + } }, /** * @api {方法} rotateAngle(angle) 改变垂直角度 @@ -3170,6 +3178,8 @@ MainMap_QM.prototype = { clearTimeout(shopTime); isJUZ = false; Map_QM.controls.reset() + let angle = Map_QM.util.options.deviceAng ? Map_QM.util.deviceObj.angle : Map_QM.util.mapAngle + Map_QM.rotationAngle(angle) }, 3000); } if (debug) {