Browse Source

feat: 垂直测量

jinx 2 years ago
parent
commit
02b8952df0
2 changed files with 5 additions and 8 deletions
  1. 1 2
      src/graphic/Controls/AddPoint.js
  2. 4 6
      src/graphic/Layer.js

+ 1 - 2
src/graphic/Controls/AddPoint.js

@@ -40,7 +40,7 @@ export default class AddPoint {
         newPoint.setLocationMode(Constant.allLocationMode);
         stateService.setEventName(LayerEvents.AddPoint);
       } else if (
-        Settings.selectBasePointId != null && 
+        Settings.baseLineId != null && 
         Settings.selectLocationMode == Constant.normalLocationMode
         ) {
         newPoint = pointService.create(position);
@@ -187,7 +187,6 @@ export default class AddPoint {
   }
 
   deleteTestPoints() {
-    console.log(this.testPointIds)
     for (let i = 0; i < this.testPointIds.length; ++i) {
       pointService.deletePoint(this.testPointIds[i]);
     }

+ 4 - 6
src/graphic/Layer.js

@@ -150,7 +150,6 @@ export default class Layer {
         break;
       case LayerEvents.AddPoint:
         stateService.setEventName(LayerEvents.MovePoint);
-        console.error(1, Settings.selectLocationMode);
         const newPoint = addPoint.buildPoint(position);
         if (newPoint) {
           stateService.setSelectItem(newPoint.vectorId, VectorType.Point, SelectState.Select);
@@ -277,7 +276,6 @@ export default class Layer {
     }
     selectItem = stateService.getSelectItem();
     stateService.setDraggingItem(selectItem);
-    console.log(selectItem);
     // 清除上一个状态
     // 设置当前事件名称
     e.preventDefault();
@@ -823,7 +821,6 @@ export default class Layer {
       y: Y,
     });
     let needAutoRedraw = false;
-    console.error(eventName);
     switch (eventName) {
       case null:
         return;
@@ -1254,9 +1251,10 @@ export default class Layer {
       } else if (eventName == LayerEvents.AddLine) {
         stateService.setEventName(LayerEvents.AddingLine);
       } else if (
-        eventName == LayerEvents.AddPoint &&
-        Settings.selectBasePointId != null &&
-        (Settings.selectLocationMode == Constant.angleLocationMode || Settings.selectLocationMode == Constant.allLocationMode || Settings.selectLocationMode == Constant.normalLocationMode)
+        (eventName == LayerEvents.AddPoint &&
+          Settings.selectBasePointId != null &&
+          (Settings.selectLocationMode == Constant.angleLocationMode || Settings.selectLocationMode == Constant.allLocationMode)) ||
+        (eventName == LayerEvents.AddPoint && Settings.baseLineId != null && Settings.selectLocationMode == Constant.normalLocationMode)
       ) {
       } else {
         stateService.clearEventName();