xushiting 2 lat temu
rodzic
commit
cae120e997

+ 4 - 1
src/graphic/Controls/MoveLine.js

@@ -165,7 +165,10 @@ export default class MoveLine {
       }
     } else {
       if (line.getCategory() == VectorCategory.Line.BaseLine) {
-        if (uiService.getSelectLocationMode() == Constant.angleLocationMode) {
+        if (
+          uiService.getSelectLocationMode() == Constant.angleLocationMode ||
+          lineService.hasLocationModeByAngle()
+        ) {
           let msg = locationModeControl.beforeSetLocation();
           if (msg != Msg.OK) {
             uiService.prompt({ msg: msg, time: 1000 });

+ 1 - 0
src/graphic/Controls/UIControl.js

@@ -101,6 +101,7 @@ export default class UIControl {
           this.layer.exit();
         }
         //恢复默认
+        uiService.setSelectLocationMode(null);
         uiService.setSelectPointCategory(VectorCategory.Point.NormalPoint);
         uiService.setSelectLineCategory(VectorCategory.Line.NormalLine);
         //执行新的事件

+ 1 - 0
src/graphic/Load.js

@@ -36,6 +36,7 @@ export default class Load {
     this.layer.initLocation();
     coordinate.init(this.layer.canvas);
     //恢复默认
+    uiService.setSelectLocationMode(null);
     uiService.setSelectPointCategory(VectorCategory.Point.NormalPoint);
     uiService.setSelectLineCategory(VectorCategory.Line.NormalLine);
     if (dataLocal) {

+ 13 - 0
src/graphic/Service/LineService.js

@@ -8,6 +8,7 @@ import VectorCategory from "../enum/VectorCategory.js";
 import { mathUtil } from "../Util/MathUtil.js";
 import { uiService } from "./UIService.js";
 import { addLine } from "../Controls/AddLine.js";
+import Constant from "../Constant.js";
 
 export default class LineService {
   constructor() {}
@@ -94,6 +95,18 @@ export default class LineService {
     return null;
   }
 
+  //是否已经设置了直角测量法
+  hasLocationModeByAngle() {
+    let lines = dataService.getLines();
+    for (let key in lines) {
+      let line = dataService.getLine(key);
+      if (line.getLocationMode() == Constant.angleLocationMode) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   /******************************************************************************曲线**************************************************************************************/
   createCurveLine(startPosition, endPosition, vectorId) {
     if (