Browse Source

更新层级优先级

xushiting 2 years ago
parent
commit
b51005b031
1 changed files with 72 additions and 72 deletions
  1. 72 72
      src/graphic/ListenLayer.js

+ 72 - 72
src/graphic/ListenLayer.js

@@ -957,12 +957,82 @@ export default class ListenLayer {
     */
   setModifyPoint(position, info) {
     //优先级最高
-    if (
+    this.modifyPoint = {};
+    if (info && info.textInfo.textId) {
+      this.modifyPoint = {};
+      this.modifyPoint.textId = info.textInfo.textId;
+      this.modifyPoint.x = info.textInfo.x;
+      this.modifyPoint.y = info.textInfo.y;
+    } else if (info && info.magnifierInfo.magnifierId) {
+      this.modifyPoint = {};
+      this.modifyPoint.magnifierId = info.magnifierInfo.magnifierId;
+      this.modifyPoint.index = info.magnifierInfo.index;
+      this.modifyPoint.x = info.magnifierInfo.x;
+      this.modifyPoint.y = info.magnifierInfo.y;
+    } else if (info && info.circleInfo.circleId) {
+      this.modifyPoint = {};
+      this.modifyPoint.linkedCircleId = info.circleInfo.circleId;
+      this.modifyPoint.index = info.circleInfo.index;
+      this.modifyPoint.x = info.circleInfo.x;
+      this.modifyPoint.y = info.circleInfo.y;
+    } else if (
+      info &&
+      (info.pointInfo.pointId || info.curvePointInfo.curvePointId)
+    ) {
+      this.modifyPoint = {};
+      if (info.pointInfo.pointId && info.curvePointInfo.curvePointId) {
+        if (info.pointInfo.distance < info.curvePointInfo.distance) {
+          this.modifyPoint.linkedPointId = info.pointInfo.pointId;
+          this.modifyPoint.x = info.pointInfo.x;
+          this.modifyPoint.y = info.pointInfo.y;
+        } else {
+          this.modifyPoint.linkedCurvePointId =
+            info.curvePointInfo.curvePointId;
+          this.modifyPoint.x = info.curvePointInfo.x;
+          this.modifyPoint.y = info.curvePointInfo.y;
+        }
+      } else if (info.pointInfo.pointId) {
+        this.modifyPoint.linkedPointId = info.pointInfo.pointId;
+        this.modifyPoint.x = info.pointInfo.x;
+        this.modifyPoint.y = info.pointInfo.y;
+      } else if (info.curvePointInfo.curvePointId) {
+        this.modifyPoint.linkedCurvePointId = info.curvePointInfo.curvePointId;
+        this.modifyPoint.x = info.curvePointInfo.x;
+        this.modifyPoint.y = info.curvePointInfo.y;
+      }
+    } else if (
+      info &&
+      (info.lineInfo.lineId || info.curveLineInfo.curveLineId)
+    ) {
+      this.modifyPoint = {};
+      if (info.lineInfo.lineId && info.curveLineInfo.curveLineId) {
+        if (info.lineInfo.distance < info.curveLineInfo.distance) {
+          this.modifyPoint.linkedLineId = info.lineInfo.lineId;
+          this.modifyPoint.x = info.lineInfo.x;
+          this.modifyPoint.y = info.lineInfo.y;
+        } else {
+          this.modifyPoint.linkedCurveLineId = info.curveLineInfo.curveLineId;
+          this.modifyPoint.x = info.curveLineInfo.x;
+          this.modifyPoint.y = info.curveLineInfo.y;
+        }
+      } else if (info.lineInfo.lineId) {
+        this.modifyPoint.linkedLineId = info.lineInfo.lineId;
+        this.modifyPoint.x = info.lineInfo.x;
+        this.modifyPoint.y = info.lineInfo.y;
+      } else if (info.curveLineInfo.curveLineId) {
+        this.modifyPoint.linkedCurveLineId = info.curveLineInfo.curveLineId;
+        this.modifyPoint.x = info.curveLineInfo.x;
+        this.modifyPoint.y = info.curveLineInfo.y;
+      }
+    } else if (info && info.svgInfo.svgId) {
+      this.modifyPoint = {};
+      this.modifyPoint.svgId = info.svgInfo.svgId;
+      this.modifyPoint.index = info.svgInfo.index;
+    } else if (
       info &&
       (info.roadPointInfo.roadPointId ||
         info.curveRoadPointInfo.curveRoadPointId)
     ) {
-      this.modifyPoint = {};
       if (
         info.roadPointInfo.roadPointId &&
         info.curveRoadPointInfo.curveRoadPointId
@@ -1048,76 +1118,6 @@ export default class ListenLayer {
         info.crossPointInfo.crossCrossPointId;
       this.modifyPoint.x = info.crossPointInfo.x;
       this.modifyPoint.y = info.crossPointInfo.y;
-    } else if (
-      info &&
-      (info.pointInfo.pointId || info.curvePointInfo.curvePointId)
-    ) {
-      this.modifyPoint = {};
-      if (info.pointInfo.pointId && info.curvePointInfo.curvePointId) {
-        if (info.pointInfo.distance < info.curvePointInfo.distance) {
-          this.modifyPoint.linkedPointId = info.pointInfo.pointId;
-          this.modifyPoint.x = info.pointInfo.x;
-          this.modifyPoint.y = info.pointInfo.y;
-        } else {
-          this.modifyPoint.linkedCurvePointId =
-            info.curvePointInfo.curvePointId;
-          this.modifyPoint.x = info.curvePointInfo.x;
-          this.modifyPoint.y = info.curvePointInfo.y;
-        }
-      } else if (info.pointInfo.pointId) {
-        this.modifyPoint.linkedPointId = info.pointInfo.pointId;
-        this.modifyPoint.x = info.pointInfo.x;
-        this.modifyPoint.y = info.pointInfo.y;
-      } else if (info.curvePointInfo.curvePointId) {
-        this.modifyPoint.linkedCurvePointId = info.curvePointInfo.curvePointId;
-        this.modifyPoint.x = info.curvePointInfo.x;
-        this.modifyPoint.y = info.curvePointInfo.y;
-      }
-    } else if (
-      info &&
-      (info.lineInfo.lineId || info.curveLineInfo.curveLineId)
-    ) {
-      this.modifyPoint = {};
-      if (info.lineInfo.lineId && info.curveLineInfo.curveLineId) {
-        if (info.lineInfo.distance < info.curveLineInfo.distance) {
-          this.modifyPoint.linkedLineId = info.lineInfo.lineId;
-          this.modifyPoint.x = info.lineInfo.x;
-          this.modifyPoint.y = info.lineInfo.y;
-        } else {
-          this.modifyPoint.linkedCurveLineId = info.curveLineInfo.curveLineId;
-          this.modifyPoint.x = info.curveLineInfo.x;
-          this.modifyPoint.y = info.curveLineInfo.y;
-        }
-      } else if (info.lineInfo.lineId) {
-        this.modifyPoint.linkedLineId = info.lineInfo.lineId;
-        this.modifyPoint.x = info.lineInfo.x;
-        this.modifyPoint.y = info.lineInfo.y;
-      } else if (info.curveLineInfo.curveLineId) {
-        this.modifyPoint.linkedCurveLineId = info.curveLineInfo.curveLineId;
-        this.modifyPoint.x = info.curveLineInfo.x;
-        this.modifyPoint.y = info.curveLineInfo.y;
-      }
-    } else if (info && info.svgInfo.svgId) {
-      this.modifyPoint = {};
-      this.modifyPoint.svgId = info.svgInfo.svgId;
-      this.modifyPoint.index = info.svgInfo.index;
-    } else if (info && info.magnifierInfo.magnifierId) {
-      this.modifyPoint = {};
-      this.modifyPoint.magnifierId = info.magnifierInfo.magnifierId;
-      this.modifyPoint.index = info.magnifierInfo.index;
-      this.modifyPoint.x = info.magnifierInfo.x;
-      this.modifyPoint.y = info.magnifierInfo.y;
-    } else if (info && info.circleInfo.circleId) {
-      this.modifyPoint = {};
-      this.modifyPoint.linkedCircleId = info.circleInfo.circleId;
-      this.modifyPoint.index = info.circleInfo.index;
-      this.modifyPoint.x = info.circleInfo.x;
-      this.modifyPoint.y = info.circleInfo.y;
-    } else if (info && info.textInfo.textId) {
-      this.modifyPoint = {};
-      this.modifyPoint.textId = info.textInfo.textId;
-      this.modifyPoint.x = info.textInfo.x;
-      this.modifyPoint.y = info.textInfo.y;
     } else if (info && info.roadPointInfo.linkedRoadPointIdX) {
       this.modifyPoint = {};
       this.modifyPoint.linkedRoadPointIdX =