瀏覽代碼

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

# Conflicts:
#	src/graphic/Layer.js
xushiting 2 年之前
父節點
當前提交
5601bc3ed6

+ 35 - 7
public/static/lib/potree/potree.js

@@ -54112,6 +54112,7 @@
 	        let done = ()=>{ //一定要旋转和位移都结束了才能执行
 	        let done = ()=>{ //一定要旋转和位移都结束了才能执行
 	            
 	            
 	            let f = ()=>{
 	            let f = ()=>{
+	                this.position.copy(endPosition);  //因为延时1后control的update会导致位置改变
 	                info.callback && info.callback();     
 	                info.callback && info.callback();     
 	                this.dispatchEvent('flyingDone');  
 	                this.dispatchEvent('flyingDone');  
 	                viewer.dispatchEvent('content_changed');
 	                viewer.dispatchEvent('content_changed');
@@ -83726,10 +83727,10 @@ void main()
 	        let click = (e)=>{//一旦点击就立刻增加两marker  
 	        let click = (e)=>{//一旦点击就立刻增加两marker  
 	         
 	         
 	            if(ifAtWrongPlace(e))return  
 	            if(ifAtWrongPlace(e))return  
-	            if(e.clickElement)return  //如点击label时focusOnObject
+	            if(e.clickElement || e.drag.object)return  //如点击label时focusOnObject, 或拖拽marker
 	             
 	             
 	            
 	            
-	            if(e.button === MOUSE.RIGHT)return 
+	            if(e.button === MOUSE.RIGHT )return  
 	            
 	            
 	            if(isMobile){
 	            if(isMobile){
 	                viewer.controls.setEnable(false);
 	                viewer.controls.setEnable(false);
@@ -97383,14 +97384,24 @@ ENDSEC
 	        //Potree.Log('hope flyToPano: '+toPano.pano.id )
 	        //Potree.Log('hope flyToPano: '+toPano.pano.id )
 	        
 	        
 	        
 	        
-	        if(this.latestToPano && this.latestToPano != toPano && this.latestToPano.pano != this.currentPano){//还在飞//如果旧的toPano只是旋转镜头,就直接取消旧的
+	       
+	        //如果旧的toPano只是旋转镜头,就直接取消旧的
+	        
+	        
+	        
+	        if(this.latestToPano && this.latestToPano != toPano && (//还在飞
+	            this.latestToPano.pano != this.currentPano || !this.isAtPano())){//如果旧的toPano只在pano旋转镜头,就直接取消旧的,继续执行 
 	            return done(false) 
 	            return done(false) 
 	        }
 	        }
-	        //Potree.Log('flyToPano: '+toPano.pano.id,  this.latestToPano && this.latestToPano.pano.id )
+	         
 	        if(this.currentPano == toPano.pano && this.isAtPano() && !toPano.target && !toPano.quaternion  ){
 	        if(this.currentPano == toPano.pano && this.isAtPano() && !toPano.target && !toPano.quaternion  ){
+	            //已在该pano
 	            this.dispatchEvent({type:'flyToPano', toPano});
 	            this.dispatchEvent({type:'flyToPano', toPano});
 	            return done(true);
 	            return done(true);
 	        }
 	        }
+	     
+	        //Potree.Log('flyToPano: '+toPano.pano.id,  this.latestToPano && this.latestToPano.pano.id )
+	        
 	        
 	        
 	        let target = toPano.target;   
 	        let target = toPano.target;   
 	        let config = Potree.config.displayMode[Potree.settings.displayMode];
 	        let config = Potree.config.displayMode[Potree.settings.displayMode];
@@ -139222,9 +139233,18 @@ ENDSEC
 	                this.images360.panos.forEach(pano=>{
 	                this.images360.panos.forEach(pano=>{
 	                    Potree.Utils.updateVisible(pano, 'screenshot', true);
 	                    Potree.Utils.updateVisible(pano, 'screenshot', true);
 	                }); 
 	                }); 
-	                viewer.scene.measurements.forEach((e)=>{
-	                    Potree.Utils.updateVisible(e, 'screenshot', true);  
-	                });
+	                if(info.hideMeasures){
+	                    viewer.scene.measurements.forEach((e)=>{
+	                        Potree.Utils.updateVisible(e, 'screenshot', true);  
+	                    }); 
+	                }else {
+	                    viewer.scene.measurements.forEach((e)=>{
+	                        e.edgeLabels.forEach(label=>{
+	                            label.backgroundColor.a = label._oldA  ;//透明的抗锯齿渲染会变黑,所以去除透明
+	                            label.updateTexture();  
+	                        });
+	                    });
+	                } 
 	                
 	                
 	                Potree.Utils.updateVisible(this.reticule, 'screenshot', true);
 	                Potree.Utils.updateVisible(this.reticule, 'screenshot', true);
 	                 
 	                 
@@ -139305,6 +139325,14 @@ ENDSEC
 	            viewer.scene.measurements.forEach((e)=>{
 	            viewer.scene.measurements.forEach((e)=>{
 	                Potree.Utils.updateVisible(e, 'screenshot', false);  
 	                Potree.Utils.updateVisible(e, 'screenshot', false);  
 	            });
 	            });
+	        }else {
+	            viewer.scene.measurements.forEach((e)=>{
+	                e.edgeLabels.forEach(label=>{
+	                    label._oldA = label.backgroundColor.a;
+	                    label.backgroundColor.a = 1 ;//透明的抗锯齿渲染会变黑,所以去除透明
+	                    label.updateTexture();  
+	                });
+	            });
 	        }            
 	        }            
 	        Potree.Utils.updateVisible(this.reticule, 'screenshot', false);//令reticule不可见 
 	        Potree.Utils.updateVisible(this.reticule, 'screenshot', false);//令reticule不可见 
 	                                
 	                                

文件差異過大導致無法顯示
+ 1 - 1
public/static/lib/potree/potree.js.map


文件差異過大導致無法顯示
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 2 - 0
src/graphic/History/Change.js

@@ -94,6 +94,7 @@ export default class Change {
       this.currentData.curveRoadEdges.length == 0 &&
       this.currentData.curveRoadEdges.length == 0 &&
       this.currentData.curveRoads.length == 0 &&
       this.currentData.curveRoads.length == 0 &&
       this.currentData.crossPoints.length == 0 &&
       this.currentData.crossPoints.length == 0 &&
+      this.currentData.svgs.length == 0 &&
       !this.currentData.settings
       !this.currentData.settings
     ) {
     ) {
       this.saveCurrentInfo();
       this.saveCurrentInfo();
@@ -413,6 +414,7 @@ export default class Change {
         }
         }
       }
       }
       delete this.lastData.svgs[key];
       delete this.lastData.svgs[key];
+  
     }
     }
 
 
     for (const key in this.lastData.svgs) {
     for (const key in this.lastData.svgs) {

+ 9 - 1
src/graphic/History/HistoryUtil.js

@@ -28,7 +28,9 @@ export default class HistoryUtil {
       line1.startId == line2.startId &&
       line1.startId == line2.startId &&
       line1.endId == line2.endId &&
       line1.endId == line2.endId &&
       line1.category == line2.category &&
       line1.category == line2.category &&
-      line1.locationMode == line2.locationMode
+      line1.locationMode == line2.locationMode && 
+      line1.style == line2.style && 
+      line1.weight == line2.weight 
     ) {
     ) {
       return false;
       return false;
     } else {
     } else {
@@ -350,6 +352,8 @@ export default class HistoryUtil {
     lineInfo.category = line2.category;
     lineInfo.category = line2.category;
     lineInfo.locationMode = line2.locationMode;
     lineInfo.locationMode = line2.locationMode;
     lineInfo.value = line2.value;
     lineInfo.value = line2.value;
+    lineInfo.style = line2.style;
+    lineInfo.weight = line2.weight;
     this.setLineInfo(lineInfo);
     this.setLineInfo(lineInfo);
   }
   }
 
 
@@ -592,6 +596,8 @@ export default class HistoryUtil {
     data.category = line.category;
     data.category = line.category;
     data.locationMode = line.locationMode;
     data.locationMode = line.locationMode;
     data.type = line.geoType;
     data.type = line.geoType;
+    data.style = line.style;
+    data.weight = line.weight;
     return data;
     return data;
   }
   }
 
 
@@ -821,6 +827,8 @@ export default class HistoryUtil {
     line.category = lineInfo.category;
     line.category = lineInfo.category;
     line.locationMode = lineInfo.locationMode;
     line.locationMode = lineInfo.locationMode;
     line.value = lineInfo.value;
     line.value = lineInfo.value;
+    line.style = lineInfo.style;
+    line.weight = lineInfo.weight;
     return line;
     return line;
   }
   }
 
 

+ 141 - 322
src/graphic/Layer.js

@@ -1,48 +1,48 @@
-import Load from "./Load";
-import { stateService } from "./Service/StateService";
-import { elementService } from "./Service/ElementService";
-import { dataService } from "./Service/DataService";
-import { textService } from "./Service/TextService";
-import { historyService } from "./Service/HistoryService";
-import UIControl from "./Controls/UIControl";
+import Load from './Load';
+import { stateService } from './Service/StateService';
+import { elementService } from './Service/ElementService';
+import { dataService } from './Service/DataService';
+import { textService } from './Service/TextService';
+import { historyService } from './Service/HistoryService';
+import UIControl from './Controls/UIControl';
 import { locationModeControl } from "./Controls/LocationModeControl";
 import { locationModeControl } from "./Controls/LocationModeControl";
-import { moveText } from "./Controls/MoveText";
-import { moveSVG } from "./Controls/MoveSVG";
-import { moveMagnifier } from "./Controls/MoveMagnifier";
-import { addRoad } from "./Controls/AddRoad";
-import { addCrossRoad } from "./Controls/AddCrossRoad";
-import { addLine } from "./Controls/AddLine";
-import { addPoint } from "./Controls/AddPoint";
-import { addCircle } from "./Controls/AddCircle";
-import { addText } from "./Controls/AddText";
-import { addMagnifier } from "./Controls/AddMagnifier";
-import { addSVG } from "./Controls/AddSVG";
-import { moveRoad } from "./Controls/MoveRoad";
-import { moveLine } from "./Controls/MoveLine";
-import { movePoint } from "./Controls/MovePoint";
-import { moveCircle } from "./Controls/MoveCircle";
-import { coordinate } from "./Coordinate";
-import Render from "./Renderer/Render";
-import { draw } from "./Renderer/Draw";
-import { listenLayer } from "./ListenLayer";
-import LayerEvents from "./enum/LayerEvents.js";
-import UIEvents from "./enum/UIEvents.js";
-import SelectState from "./enum/SelectState.js";
-import VectorType from "./enum/VectorType";
-import { mathUtil } from "./Util/MathUtil";
-import History from "./History/History";
-import mitt from "mitt";
-import { roadService } from "./Service/RoadService";
-import { edgeService } from "./Service/EdgeService";
-import { roadPointService } from "./Service/RoadPointService";
-import { curveRoadService } from "./Service/CurveRoadService";
-import VectorCategory from "./enum/VectorCategory";
-import Settings from "./Settings";
-import Constant from "./Constant";
-import { uiService } from "./Service/UIService";
-import { imageService } from "./Service/ImageService";
-import VectorEvents from "./enum/VectorEvents";
-import { lineService } from "./Service/LineService";
+import { moveText } from './Controls/MoveText';
+import { moveSVG } from './Controls/MoveSVG';
+import { moveMagnifier } from './Controls/MoveMagnifier';
+import { addRoad } from './Controls/AddRoad';
+import { addCrossRoad } from './Controls/AddCrossRoad';
+import { addLine } from './Controls/AddLine';
+import { addPoint } from './Controls/AddPoint';
+import { addCircle } from './Controls/AddCircle';
+import { addText } from './Controls/AddText';
+import { addMagnifier } from './Controls/AddMagnifier';
+import { addSVG } from './Controls/AddSVG';
+import { moveRoad } from './Controls/MoveRoad';
+import { moveLine } from './Controls/MoveLine';
+import { movePoint } from './Controls/MovePoint';
+import { moveCircle } from './Controls/MoveCircle';
+import { coordinate } from './Coordinate';
+import Render from './Renderer/Render';
+import { draw } from './Renderer/Draw';
+import { listenLayer } from './ListenLayer';
+import LayerEvents from './enum/LayerEvents.js';
+import UIEvents from './enum/UIEvents.js';
+import SelectState from './enum/SelectState.js';
+import VectorType from './enum/VectorType';
+import { mathUtil } from './Util/MathUtil';
+import History from './History/History';
+import mitt from 'mitt';
+import { roadService } from './Service/RoadService';
+import { edgeService } from './Service/EdgeService';
+import { roadPointService } from './Service/RoadPointService';
+import { curveRoadService } from './Service/CurveRoadService';
+import VectorCategory from './enum/VectorCategory';
+import Settings from './Settings';
+import Constant from './Constant';
+import { uiService } from './Service/UIService';
+import { imageService } from './Service/ImageService';
+import VectorEvents from './enum/VectorEvents';
+import { lineService } from './Service/LineService';
 
 
 const minDragDis = 10;
 const minDragDis = 10;
 const minZoom = 20;
 const minZoom = 20;
@@ -77,25 +77,25 @@ export default class Layer {
   }
   }
 
 
   bindEvents() {
   bindEvents() {
-    this.canvas.addEventListener("contextmenu", function (e) {
+    this.canvas.addEventListener('contextmenu', function (e) {
       e.preventDefault();
       e.preventDefault();
     });
     });
-    this.canvas.addEventListener("mousedown", this.onMouseDown.bind(this));
-    this.canvas.addEventListener("mousemove", this.onMouseMove.bind(this));
-    this.canvas.addEventListener("mouseup", this.onMouseUp.bind(this));
+    this.canvas.addEventListener('mousedown', this.onMouseDown.bind(this));
+    this.canvas.addEventListener('mousemove', this.onMouseMove.bind(this));
+    this.canvas.addEventListener('mouseup', this.onMouseUp.bind(this));
 
 
-    this.canvas.addEventListener("touchstart", this.onMouseDown.bind(this));
-    this.canvas.addEventListener("touchmove", this.onMouseMove.bind(this));
-    this.canvas.addEventListener("touchend", this.onMouseUp.bind(this));
+    this.canvas.addEventListener('touchstart', this.onMouseDown.bind(this));
+    this.canvas.addEventListener('touchmove', this.onMouseMove.bind(this));
+    this.canvas.addEventListener('touchend', this.onMouseUp.bind(this));
 
 
-    this.canvas.addEventListener("mousewheel", this.onWheel.bind(this));
-    this.canvas.addEventListener("DOMMouseScroll", this.onWheel.bind(this));
-    this.canvas.addEventListener("resize", this.reSize.bind(this));
+    this.canvas.addEventListener('mousewheel', this.onWheel.bind(this));
+    this.canvas.addEventListener('DOMMouseScroll', this.onWheel.bind(this));
+    this.canvas.addEventListener('resize', this.reSize.bind(this));
     document.addEventListener("keydown", this.onKeydown.bind(this));
     document.addEventListener("keydown", this.onKeydown.bind(this));
   }
   }
 
 
   reSize = function () {
   reSize = function () {
-    console.log("resize");
+    console.log('resize');
     coordinate.updateForCanvas();
     coordinate.updateForCanvas();
     this.renderer.autoRedraw();
     this.renderer.autoRedraw();
   };
   };
@@ -131,16 +131,16 @@ export default class Layer {
     let selectItem = stateService.getSelectItem();
     let selectItem = stateService.getSelectItem();
     let focusItem = stateService.getFocusItem();
     let focusItem = stateService.getFocusItem();
 
 
-    this.setEventName("mouseDown");
+    this.setEventName('mouseDown');
     const eventName = stateService.getEventName();
     const eventName = stateService.getEventName();
     switch (eventName) {
     switch (eventName) {
       case LayerEvents.AddRoad:
       case LayerEvents.AddRoad:
         stateService.setEventName(LayerEvents.AddingRoad);
         stateService.setEventName(LayerEvents.AddingRoad);
-        addRoad.setNewRoadPoint("start", position);
+        addRoad.setNewRoadPoint('start', position);
         break;
         break;
       case LayerEvents.AddCurveRoad:
       case LayerEvents.AddCurveRoad:
         stateService.setEventName(LayerEvents.AddingCurveRoad);
         stateService.setEventName(LayerEvents.AddingCurveRoad);
-        addRoad.setNewRoadPoint("start", position);
+        addRoad.setNewRoadPoint('start', position);
         break;
         break;
       case LayerEvents.AddLine:
       case LayerEvents.AddLine:
         stateService.setEventName(LayerEvents.AddingLine);
         stateService.setEventName(LayerEvents.AddingLine);
@@ -154,18 +154,14 @@ export default class Layer {
         stateService.setEventName(LayerEvents.MovePoint);
         stateService.setEventName(LayerEvents.MovePoint);
         const newPoint = addPoint.buildPoint2(position);
         const newPoint = addPoint.buildPoint2(position);
         if (newPoint) {
         if (newPoint) {
-          stateService.setSelectItem(
-            newPoint.vectorId,
-            VectorType.Point,
-            SelectState.Select
-          );
+          stateService.setSelectItem(newPoint.vectorId, VectorType.Point, SelectState.Select);
           this.history.save();
           this.history.save();
           this.renderer.autoRedraw();
           this.renderer.autoRedraw();
         } else {
         } else {
           if (Settings.basePointIds.length > 1) {
           if (Settings.basePointIds.length > 1) {
-            this.uiControl.prompt({ msg: "请先选择基准点", time: 1000 });
+            this.uiControl.prompt({ msg: '请先选择基准点', time: 1000 });
           } else {
           } else {
-            this.uiControl.prompt({ msg: "请先添加基准点", time: 1000 });
+            this.uiControl.prompt({ msg: '请先添加基准点', time: 1000 });
           }
           }
 
 
           // this.uiControl.prompt({ msg: '请先选择基准点', time: 1000 });
           // this.uiControl.prompt({ msg: '请先选择基准点', time: 1000 });
@@ -179,11 +175,7 @@ export default class Layer {
       case LayerEvents.AddText:
       case LayerEvents.AddText:
         stateService.setEventName(LayerEvents.MoveText);
         stateService.setEventName(LayerEvents.MoveText);
         addText.buildText(position);
         addText.buildText(position);
-        stateService.setSelectItem(
-          addText.newText.vectorId,
-          VectorType.Text,
-          SelectState.Select
-        );
+        stateService.setSelectItem(addText.newText.vectorId, VectorType.Text, SelectState.Select);
         addText.clear();
         addText.clear();
         break;
         break;
       case LayerEvents.AddSVG:
       case LayerEvents.AddSVG:
@@ -197,11 +189,7 @@ export default class Layer {
       case LayerEvents.AddMagnifier:
       case LayerEvents.AddMagnifier:
         stateService.setEventName(LayerEvents.MoveMagnifier);
         stateService.setEventName(LayerEvents.MoveMagnifier);
         addMagnifier.buildMagnifier(position);
         addMagnifier.buildMagnifier(position);
-        stateService.setSelectItem(
-          addMagnifier.newMagnifier.vectorId,
-          VectorType.Magnifier,
-          SelectState.Select
-        );
+        stateService.setSelectItem(addMagnifier.newMagnifier.vectorId, VectorType.Magnifier, SelectState.Select);
         addMagnifier.clear();
         addMagnifier.clear();
         break;
         break;
       case VectorEvents.AddLane:
       case VectorEvents.AddLane:
@@ -209,34 +197,18 @@ export default class Layer {
           let road = dataService.getRoad(selectItem.vectorId);
           let road = dataService.getRoad(selectItem.vectorId);
           if (road) {
           if (road) {
             let roadLanCount = road.getLanesCount(selectItem.dir);
             let roadLanCount = road.getLanesCount(selectItem.dir);
-            if (selectItem.dir == "left") {
-              roadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                roadLanCount + 1,
-                selectItem.dir
-              );
+            if (selectItem.dir == 'left') {
+              roadService.updateForAddSubtractLanesCount(road.vectorId, roadLanCount + 1, selectItem.dir);
             } else {
             } else {
-              roadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                roadLanCount + 1,
-                selectItem.dir
-              );
+              roadService.updateForAddSubtractLanesCount(road.vectorId, roadLanCount + 1, selectItem.dir);
             }
             }
           } else {
           } else {
             road = dataService.getCurveRoad(selectItem.vectorId);
             road = dataService.getCurveRoad(selectItem.vectorId);
             let curveRoadLanCount = road.getLanesCount(selectItem.dir);
             let curveRoadLanCount = road.getLanesCount(selectItem.dir);
-            if (selectItem.dir == "left") {
-              curveRoadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                curveRoadLanCount + 1,
-                selectItem.dir
-              );
+            if (selectItem.dir == 'left') {
+              curveRoadService.updateForAddSubtractLanesCount(road.vectorId, curveRoadLanCount + 1, selectItem.dir);
             } else {
             } else {
-              curveRoadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                curveRoadLanCount + 1,
-                selectItem.dir
-              );
+              curveRoadService.updateForAddSubtractLanesCount(road.vectorId, curveRoadLanCount + 1, selectItem.dir);
             }
             }
           }
           }
           stateService.clearEventName();
           stateService.clearEventName();
@@ -249,34 +221,18 @@ export default class Layer {
           let road = dataService.getRoad(selectItem.vectorId);
           let road = dataService.getRoad(selectItem.vectorId);
           if (road) {
           if (road) {
             let roadLanCount = road.getLanesCount(selectItem.dir);
             let roadLanCount = road.getLanesCount(selectItem.dir);
-            if (selectItem.dir == "left") {
-              roadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                roadLanCount - 1,
-                selectItem.dir
-              );
+            if (selectItem.dir == 'left') {
+              roadService.updateForAddSubtractLanesCount(road.vectorId, roadLanCount - 1, selectItem.dir);
             } else {
             } else {
-              roadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                roadLanCount - 1,
-                selectItem.dir
-              );
+              roadService.updateForAddSubtractLanesCount(road.vectorId, roadLanCount - 1, selectItem.dir);
             }
             }
           } else {
           } else {
             road = dataService.getCurveRoad(selectItem.vectorId);
             road = dataService.getCurveRoad(selectItem.vectorId);
             let curveRoadLanCount = road.getLanesCount(selectItem.dir);
             let curveRoadLanCount = road.getLanesCount(selectItem.dir);
-            if (selectItem.dir == "left") {
-              curveRoadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                curveRoadLanCount - 1,
-                selectItem.dir
-              );
+            if (selectItem.dir == 'left') {
+              curveRoadService.updateForAddSubtractLanesCount(road.vectorId, curveRoadLanCount - 1, selectItem.dir);
             } else {
             } else {
-              curveRoadService.updateForAddSubtractLanesCount(
-                road.vectorId,
-                curveRoadLanCount - 1,
-                selectItem.dir
-              );
+              curveRoadService.updateForAddSubtractLanesCount(road.vectorId, curveRoadLanCount - 1, selectItem.dir);
             }
             }
           }
           }
           stateService.clearEventName();
           stateService.clearEventName();
@@ -288,18 +244,12 @@ export default class Layer {
         if (focusItem && focusItem.vectorId) {
         if (focusItem && focusItem.vectorId) {
           if (focusItem.type == VectorType.CurveRoad) {
           if (focusItem.type == VectorType.CurveRoad) {
             const curveRoad = dataService.getCurveRoad(focusItem.vectorId);
             const curveRoad = dataService.getCurveRoad(focusItem.vectorId);
-            let index = mathUtil.getIndexForCurvesPoints(
-              position,
-              curveRoad.points
-            );
+            let index = mathUtil.getIndexForCurvesPoints(position, curveRoad.points);
             if (index != -1) {
             if (index != -1) {
               curveRoadService.addCPoint(curveRoad, position, index);
               curveRoadService.addCPoint(curveRoad, position, index);
             } else {
             } else {
               const dis1 = mathUtil.getDistance(curveRoad.points[0], position);
               const dis1 = mathUtil.getDistance(curveRoad.points[0], position);
-              const dis2 = mathUtil.getDistance(
-                curveRoad.points[curveRoad.points.length - 1],
-                position
-              );
+              const dis2 = mathUtil.getDistance(curveRoad.points[curveRoad.points.length - 1], position);
               if (dis1 > dis2) {
               if (dis1 > dis2) {
                 index = curveRoad.points.length - 2;
                 index = curveRoad.points.length - 2;
               } else {
               } else {
@@ -324,18 +274,12 @@ export default class Layer {
             curveLine.setWeight(weight);
             curveLine.setWeight(weight);
           } else if (focusItem.type == VectorType.CurveLine) {
           } else if (focusItem.type == VectorType.CurveLine) {
             let curveLine = dataService.getCurveLine(focusItem.vectorId);
             let curveLine = dataService.getCurveLine(focusItem.vectorId);
-            let index = mathUtil.getIndexForCurvesPoints(
-              position,
-              curveLine.points
-            );
+            let index = mathUtil.getIndexForCurvesPoints(position, curveLine.points);
             if (index != -1) {
             if (index != -1) {
               lineService.addCPoint(position, index, focusItem.vectorId);
               lineService.addCPoint(position, index, focusItem.vectorId);
             } else {
             } else {
               const dis1 = mathUtil.getDistance(curveLine.points[0], position);
               const dis1 = mathUtil.getDistance(curveLine.points[0], position);
-              const dis2 = mathUtil.getDistance(
-                curveLine.points[curveLine.points.length - 1],
-                position
-              );
+              const dis2 = mathUtil.getDistance(curveLine.points[curveLine.points.length - 1], position);
               if (dis1 > dis2) {
               if (dis1 > dis2) {
                 index = curveLine.points.length - 2;
                 index = curveLine.points.length - 2;
               } else {
               } else {
@@ -375,10 +319,10 @@ export default class Layer {
   onMouseMove(e) {
   onMouseMove(e) {
     let X = e.offsetX || e.layerX;
     let X = e.offsetX || e.layerX;
     let Y = e.offsetY || e.layerY;
     let Y = e.offsetY || e.layerY;
-
     if (e instanceof TouchEvent) {
     if (e instanceof TouchEvent) {
       X = e.touches[0].pageX;
       X = e.touches[0].pageX;
       Y = e.touches[0].pageY;
       Y = e.touches[0].pageY;
+
       //切换到缩放
       //切换到缩放
       if (e.touches.length > 1) {
       if (e.touches.length > 1) {
         //记录开始的两个触摸点的坐标
         //记录开始的两个触摸点的坐标
@@ -420,29 +364,20 @@ export default class Layer {
       x: X,
       x: X,
       y: Y,
       y: Y,
     });
     });
+
     this.mousePosition = {
     this.mousePosition = {
       x: position.x,
       x: position.x,
       y: position.y,
       y: position.y,
     };
     };
     const eventName = stateService.getEventName();
     const eventName = stateService.getEventName();
-    if (
-      !this.dragging &&
-      Math.abs(X - this.startX) < minDragDis &&
-      Math.abs(Y - this.startY) < minDragDis
-    ) {
+    if (!this.dragging && Math.abs(X - this.startX) < minDragDis && Math.abs(Y - this.startY) < minDragDis) {
       return;
       return;
     }
     }
     this.dragging = true;
     this.dragging = true;
-    if (
-      Math.abs(X - this.startX) > minDragDis ||
-      Math.abs(Y - this.startY) > minDragDis
-    ) {
+    if (Math.abs(X - this.startX) > minDragDis || Math.abs(Y - this.startY) > minDragDis) {
       // 是否拖拽了
       // 是否拖拽了
       if (eventName != null) {
       if (eventName != null) {
-        if (
-          eventName == LayerEvents.MoveMagnifier &&
-          stateService.getSelectItem().state != 0
-        ) {
+        if (eventName == LayerEvents.MoveMagnifier && stateService.getSelectItem().state != 0) {
         } else {
         } else {
           stateService.clearFocusItem();
           stateService.clearFocusItem();
           this.uiControl.focusVector = null;
           this.uiControl.focusVector = null;
@@ -463,17 +398,15 @@ export default class Layer {
         needAutoRedraw = listenLayer.start(position);
         needAutoRedraw = listenLayer.start(position);
         let seleteItem = stateService.getSelectItem();
         let seleteItem = stateService.getSelectItem();
         if (seleteItem != null) {
         if (seleteItem != null) {
-          console.log("选中:" + seleteItem.vectorId);
+          console.log('选中:' + seleteItem.vectorId);
         } else {
         } else {
         }
         }
         break;
         break;
       case LayerEvents.PanBackGround:
       case LayerEvents.PanBackGround:
         stateService.clearItems();
         stateService.clearItems();
         let center = {};
         let center = {};
-        center.x =
-          coordinate.center.x - (dx * coordinate.defaultZoom) / coordinate.zoom;
-        center.y =
-          coordinate.center.y + (dy * coordinate.defaultZoom) / coordinate.zoom;
+        center.x = coordinate.center.x - (dx * coordinate.defaultZoom) / coordinate.zoom;
+        center.y = coordinate.center.y + (dy * coordinate.defaultZoom) / coordinate.zoom;
         let tempCenter = {};
         let tempCenter = {};
         mathUtil.clonePoint(tempCenter, coordinate.center);
         mathUtil.clonePoint(tempCenter, coordinate.center);
         mathUtil.clonePoint(coordinate.center, center);
         mathUtil.clonePoint(coordinate.center, center);
@@ -568,12 +501,12 @@ export default class Layer {
         elementService.setNewRoad(addRoad.startInfo.position, position);
         elementService.setNewRoad(addRoad.startInfo.position, position);
         elementService.showNewRoad();
         elementService.showNewRoad();
 
 
-        addRoad.setNewRoadPoint("end", position);
+        addRoad.setNewRoadPoint('end', position);
         addRoad.canAdd = addRoad.canAddRoadForEnd(position);
         addRoad.canAdd = addRoad.canAddRoadForEnd(position);
         if (!addRoad.canAdd) {
         if (!addRoad.canAdd) {
-          elementService.setNewRoadState("error");
+          elementService.setNewRoadState('error');
         } else {
         } else {
-          elementService.setNewRoadState("normal");
+          elementService.setNewRoadState('normal');
         }
         }
         elementService.showPoint();
         elementService.showPoint();
         this.showElementLine(position, eventName);
         this.showElementLine(position, eventName);
@@ -667,16 +600,9 @@ export default class Layer {
         let road = dataService.getRoad(draggingItem.vectorId);
         let road = dataService.getRoad(draggingItem.vectorId);
         let start = dataService.getRoadPoint(road.startId);
         let start = dataService.getRoadPoint(road.startId);
         let end = dataService.getRoadPoint(road.endId);
         let end = dataService.getRoadPoint(road.endId);
-        if (
-          Object.keys(start.getParent()).length == 1 &&
-          Object.keys(end.getParent()).length == 1
-        ) {
+        if (Object.keys(start.getParent()).length == 1 && Object.keys(end.getParent()).length == 1) {
           //拖拽的路只有一条
           //拖拽的路只有一条
-          moveRoad.moveRoad(
-            draggingItem.vectorId,
-            (dx * coordinate.defaultZoom) / coordinate.zoom,
-            (dy * coordinate.defaultZoom) / coordinate.zoom
-          );
+          moveRoad.moveRoad(draggingItem.vectorId, (dx * coordinate.defaultZoom) / coordinate.zoom, (dy * coordinate.defaultZoom) / coordinate.zoom);
         }
         }
         break;
         break;
       case LayerEvents.MoveRoadPoint:
       case LayerEvents.MoveRoadPoint:
@@ -687,10 +613,7 @@ export default class Layer {
         });
         });
         if (
         if (
           listenLayer.modifyPoint &&
           listenLayer.modifyPoint &&
-          (listenLayer.modifyPoint.linkedRoadPointId ||
-            listenLayer.modifyPoint.linkedRoadId ||
-            listenLayer.modifyPoint.linkedRoadPointIdX ||
-            listenLayer.modifyPoint.linkedRoadPointIdY)
+          (listenLayer.modifyPoint.linkedRoadPointId || listenLayer.modifyPoint.linkedRoadId || listenLayer.modifyPoint.linkedRoadPointIdX || listenLayer.modifyPoint.linkedRoadPointIdY)
         ) {
         ) {
           position = {
           position = {
             x: listenLayer.modifyPoint.x,
             x: listenLayer.modifyPoint.x,
@@ -700,11 +623,7 @@ export default class Layer {
           listenLayer.modifyPoint = null;
           listenLayer.modifyPoint = null;
         }
         }
 
 
-        let flag = moveRoad.moveingRoadPoint(
-          draggingItem.vectorId,
-          position,
-          listenLayer.modifyPoint
-        );
+        let flag = moveRoad.moveingRoadPoint(draggingItem.vectorId, position, listenLayer.modifyPoint);
         if (!flag) {
         if (!flag) {
           elementService.hideAll();
           elementService.hideAll();
         } else {
         } else {
@@ -740,23 +659,19 @@ export default class Layer {
         elementService.setNewRoad(addRoad.startInfo.position, position);
         elementService.setNewRoad(addRoad.startInfo.position, position);
         elementService.showNewRoad();
         elementService.showNewRoad();
 
 
-        addRoad.setNewRoadPoint("end", position);
+        addRoad.setNewRoadPoint('end', position);
         addRoad.canAdd = addRoad.canAddRoadForEnd(position);
         addRoad.canAdd = addRoad.canAddRoadForEnd(position);
         if (!addRoad.canAdd) {
         if (!addRoad.canAdd) {
-          elementService.setNewRoadState("error");
+          elementService.setNewRoadState('error');
         } else {
         } else {
-          elementService.setNewRoadState("normal");
+          elementService.setNewRoadState('normal');
         }
         }
         elementService.showPoint();
         elementService.showPoint();
         this.showElementLine(position, eventName);
         this.showElementLine(position, eventName);
         break;
         break;
       case LayerEvents.MoveCurveRoad:
       case LayerEvents.MoveCurveRoad:
         needAutoRedraw = true;
         needAutoRedraw = true;
-        moveRoad.moveCurveRoad(
-          draggingItem.vectorId,
-          (dx * coordinate.defaultZoom) / coordinate.zoom,
-          (dy * coordinate.defaultZoom) / coordinate.zoom
-        );
+        moveRoad.moveCurveRoad(draggingItem.vectorId, (dx * coordinate.defaultZoom) / coordinate.zoom, (dy * coordinate.defaultZoom) / coordinate.zoom);
         break;
         break;
       case LayerEvents.MoveCurveRoadPoint:
       case LayerEvents.MoveCurveRoadPoint:
         if (!draggingItem || !draggingItem.vectorId) {
         if (!draggingItem || !draggingItem.vectorId) {
@@ -799,21 +714,13 @@ export default class Layer {
         break;
         break;
       case LayerEvents.MoveCurveEdge:
       case LayerEvents.MoveCurveEdge:
         if (listenLayer.modifyPoint) {
         if (listenLayer.modifyPoint) {
-          moveRoad.moveCurveEdge(
-            draggingItem.vectorId,
-            listenLayer.modifyPoint.selectIndex,
-            position
-          );
+          moveRoad.moveCurveEdge(draggingItem.vectorId, listenLayer.modifyPoint.selectIndex, position);
         }
         }
         needAutoRedraw = true;
         needAutoRedraw = true;
         break;
         break;
       case LayerEvents.MoveLine:
       case LayerEvents.MoveLine:
         if (draggingItem != null) {
         if (draggingItem != null) {
-          let flag = moveLine.moveLine(
-            draggingItem.vectorId,
-            (dx * coordinate.defaultZoom) / coordinate.zoom,
-            (dy * coordinate.defaultZoom) / coordinate.zoom
-          );
+          let flag = moveLine.moveLine(draggingItem.vectorId, (dx * coordinate.defaultZoom) / coordinate.zoom, (dy * coordinate.defaultZoom) / coordinate.zoom);
           if (!flag) {
           if (!flag) {
             this.lastX = this.lastX - dx / coordinate.ratio;
             this.lastX = this.lastX - dx / coordinate.ratio;
             this.lastY = this.lastY - dy / coordinate.ratio;
             this.lastY = this.lastY - dy / coordinate.ratio;
@@ -828,7 +735,10 @@ export default class Layer {
             exceptPointId: draggingItem.vectorId,
             exceptPointId: draggingItem.vectorId,
             exceptLineId: point.parent,
             exceptLineId: point.parent,
           });
           });
-          if (listenLayer.modifyPoint) {
+
+
+          // if (listenLayer.modifyPoint) {  //原本是这样的,不知用途,下面修改为了修复拖动点经过放大镜导致NaN或者错位
+          if (listenLayer.modifyPoint && listenLayer.modifyPoint.x && listenLayer.modifyPoint.y) {
             position = {
             position = {
               x: listenLayer.modifyPoint.x,
               x: listenLayer.modifyPoint.x,
               y: listenLayer.modifyPoint.y,
               y: listenLayer.modifyPoint.y,
@@ -866,33 +776,16 @@ export default class Layer {
         break;
         break;
       case LayerEvents.MoveCurveLine:
       case LayerEvents.MoveCurveLine:
         if (draggingItem != null) {
         if (draggingItem != null) {
-          moveLine.moveCurveLine(
-            draggingItem.vectorId,
-            (dx * coordinate.defaultZoom) / coordinate.zoom,
-            (dy * coordinate.defaultZoom) / coordinate.zoom
-          );
+          moveLine.moveCurveLine(draggingItem.vectorId, (dx * coordinate.defaultZoom) / coordinate.zoom, (dy * coordinate.defaultZoom) / coordinate.zoom);
           needAutoRedraw = true;
           needAutoRedraw = true;
         }
         }
         break;
         break;
       case LayerEvents.MoveCircle:
       case LayerEvents.MoveCircle:
         if (draggingItem != null) {
         if (draggingItem != null) {
           if (draggingItem.state == -1) {
           if (draggingItem.state == -1) {
-            moveCircle.moveFull(
-              draggingItem.vectorId,
-              (dx * coordinate.defaultZoom) / coordinate.zoom,
-              (dy * coordinate.defaultZoom) / coordinate.zoom
-            );
-          } else if (
-            draggingItem.state == 0 ||
-            draggingItem.state == 1 ||
-            draggingItem.state == 2 ||
-            draggingItem.state == 3
-          ) {
-            moveCircle.movePoint(
-              position,
-              draggingItem.vectorId,
-              draggingItem.state
-            );
+            moveCircle.moveFull(draggingItem.vectorId, (dx * coordinate.defaultZoom) / coordinate.zoom, (dy * coordinate.defaultZoom) / coordinate.zoom);
+          } else if (draggingItem.state == 0 || draggingItem.state == 1 || draggingItem.state == 2 || draggingItem.state == 3) {
+            moveCircle.movePoint(position, draggingItem.vectorId, draggingItem.state);
           } else {
           } else {
             debugger;
             debugger;
           }
           }
@@ -911,22 +804,14 @@ export default class Layer {
           if (draggingItem.state == -1) {
           if (draggingItem.state == -1) {
             moveSVG.moveFullSVG(position, draggingItem.vectorId);
             moveSVG.moveFullSVG(position, draggingItem.vectorId);
           } else {
           } else {
-            moveSVG.movePoint(
-              position,
-              draggingItem.vectorId,
-              draggingItem.state
-            );
+            moveSVG.movePoint(position, draggingItem.vectorId, draggingItem.state);
           }
           }
         }
         }
         break;
         break;
       case LayerEvents.MoveMagnifier:
       case LayerEvents.MoveMagnifier:
         needAutoRedraw = true;
         needAutoRedraw = true;
         if (draggingItem != null) {
         if (draggingItem != null) {
-          moveMagnifier.moveFullMagnifier(
-            position,
-            draggingItem.vectorId,
-            draggingItem.state
-          );
+          moveMagnifier.moveFullMagnifier(position, draggingItem.vectorId, draggingItem.state);
         }
         }
         break;
         break;
     }
     }
@@ -1003,40 +888,19 @@ export default class Layer {
             exceptRoadIds: point.parent,
             exceptRoadIds: point.parent,
           });
           });
 
 
-          if (
-            listenLayer.modifyPoint &&
-            listenLayer.modifyPoint.hasOwnProperty("linkedRoadPointId")
-          ) {
-            moveRoad.moveTo(
-              draggingItem.vectorId,
-              listenLayer.modifyPoint.linkedRoadPointId
-            );
-          } else if (
-            listenLayer.modifyPoint &&
-            (listenLayer.modifyPoint.linkedRoadPointIdX ||
-              listenLayer.modifyPoint.linkedRoadPointIdY)
-          ) {
+          if (listenLayer.modifyPoint && listenLayer.modifyPoint.hasOwnProperty('linkedRoadPointId')) {
+            moveRoad.moveTo(draggingItem.vectorId, listenLayer.modifyPoint.linkedRoadPointId);
+          } else if (listenLayer.modifyPoint && (listenLayer.modifyPoint.linkedRoadPointIdX || listenLayer.modifyPoint.linkedRoadPointIdY)) {
             mathUtil.clonePoint(point, listenLayer.modifyPoint);
             mathUtil.clonePoint(point, listenLayer.modifyPoint);
-          } else if (
-            listenLayer.modifyPoint &&
-            listenLayer.modifyPoint.hasOwnProperty("linkedRoadId")
-          ) {
+          } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.hasOwnProperty('linkedRoadId')) {
             point = roadPointService.create({
             point = roadPointService.create({
               x: listenLayer.modifyPoint.x,
               x: listenLayer.modifyPoint.x,
               y: listenLayer.modifyPoint.y,
               y: listenLayer.modifyPoint.y,
             });
             });
-            roadService.splitRoad(
-              listenLayer.modifyPoint.linkedRoadId,
-              point.vectorId,
-              "start"
-            );
+            roadService.splitRoad(listenLayer.modifyPoint.linkedRoadId, point.vectorId, 'start');
             moveRoad.moveTo(draggingItem.vectorId, point.vectorId);
             moveRoad.moveTo(draggingItem.vectorId, point.vectorId);
           } else if (moveRoad.splitRoadId != null) {
           } else if (moveRoad.splitRoadId != null) {
-            roadService.splitRoad(
-              moveRoad.splitRoadId,
-              draggingItem.vectorId,
-              "start"
-            );
+            roadService.splitRoad(moveRoad.splitRoadId, draggingItem.vectorId, 'start');
           }
           }
           //draggingItem.vectorId所在的墙面与其他墙角相交
           //draggingItem.vectorId所在的墙面与其他墙角相交
           moveRoad.updateForAbsorbRoadPoints();
           moveRoad.updateForAbsorbRoadPoints();
@@ -1175,11 +1039,8 @@ export default class Layer {
         break;
         break;
       case LayerEvents.AddPoint:
       case LayerEvents.AddPoint:
         if (
         if (
-          (Settings.selectBasePointId != null &&
-            (Settings.selectLocationMode == Constant.angleLocationMode ||
-              Settings.selectLocationMode == Constant.allLocationMode)) ||
-          (Settings.baseLineId != null &&
-            Settings.selectLocationMode == Constant.normalLocationMode)
+          (Settings.selectBasePointId != null && (Settings.selectLocationMode == Constant.angleLocationMode || Settings.selectLocationMode == Constant.allLocationMode)) ||
+          (Settings.baseLineId != null && Settings.selectLocationMode == Constant.normalLocationMode)
         ) {
         ) {
           this.uiControl.showConfirm();
           this.uiControl.showConfirm();
           needAutoRedraw = true;
           needAutoRedraw = true;
@@ -1193,7 +1054,7 @@ export default class Layer {
         break;
         break;
     }
     }
 
 
-    this.setEventName("mouseUp");
+    this.setEventName('mouseUp');
     stateService.clearDraggingItem();
     stateService.clearDraggingItem();
     if (needAutoRedraw) {
     if (needAutoRedraw) {
       this.renderer.autoRedraw();
       this.renderer.autoRedraw();
@@ -1203,11 +1064,9 @@ export default class Layer {
   onWheel(e) {
   onWheel(e) {
     e.preventDefault();
     e.preventDefault();
     const type = e.type;
     const type = e.type;
-    if (type == "DOMMouseScroll" || type == "mousewheel") {
+    if (type == 'DOMMouseScroll' || type == 'mousewheel') {
       // 当在canvas用滚轮滚动时
       // 当在canvas用滚轮滚动时
-      const delta = e.wheelDelta
-        ? (e.wheelDelta / 120) * 20
-        : (-(e.detail || 0) / 3) * 20;
+      const delta = e.wheelDelta ? (e.wheelDelta / 120) * 20 : (-(e.detail || 0) / 3) * 20;
       const zoom = coordinate.zoom + delta;
       const zoom = coordinate.zoom + delta;
       let X = e.offsetX || e.layerX;
       let X = e.offsetX || e.layerX;
       let Y = e.offsetY || e.layerY;
       let Y = e.offsetY || e.layerY;
@@ -1244,7 +1103,7 @@ export default class Layer {
   setEventName(eventType) {
   setEventName(eventType) {
     let eventName = stateService.getEventName();
     let eventName = stateService.getEventName();
 
 
-    if (eventType == "mouseDown") {
+    if (eventType == 'mouseDown') {
       if (eventName == null) {
       if (eventName == null) {
         const selectItem = stateService.getSelectItem();
         const selectItem = stateService.getSelectItem();
         if (selectItem == null) {
         if (selectItem == null) {
@@ -1281,7 +1140,7 @@ export default class Layer {
           stateService.setEventName(LayerEvents.MoveSVG);
           stateService.setEventName(LayerEvents.MoveSVG);
         }
         }
       }
       }
-    } else if (eventType == "mouseUp") {
+    } else if (eventType == 'mouseUp') {
       if (eventName == LayerEvents.AddingRoad) {
       if (eventName == LayerEvents.AddingRoad) {
         if (Settings.isMobile) {
         if (Settings.isMobile) {
           stateService.clearEventName();
           stateService.clearEventName();
@@ -1313,11 +1172,8 @@ export default class Layer {
       } else if (
       } else if (
         (eventName == LayerEvents.AddPoint &&
         (eventName == LayerEvents.AddPoint &&
           Settings.selectBasePointId != null &&
           Settings.selectBasePointId != null &&
-          (Settings.selectLocationMode == Constant.angleLocationMode ||
-            Settings.selectLocationMode == Constant.allLocationMode)) ||
-        (eventName == LayerEvents.AddPoint &&
-          Settings.baseLineId != null &&
-          Settings.selectLocationMode == Constant.normalLocationMode)
+          (Settings.selectLocationMode == Constant.angleLocationMode || Settings.selectLocationMode == Constant.allLocationMode)) ||
+        (eventName == LayerEvents.AddPoint && Settings.baseLineId != null && Settings.selectLocationMode == Constant.normalLocationMode)
       ) {
       ) {
       } else {
       } else {
         stateService.clearEventName();
         stateService.clearEventName();
@@ -1334,10 +1190,7 @@ export default class Layer {
 
 
   stopAddVector() {
   stopAddVector() {
     let eventName = stateService.getEventName();
     let eventName = stateService.getEventName();
-    if (
-      eventName != LayerEvents.AddingRoad &&
-      eventName != LayerEvents.AddingLine
-    ) {
+    if (eventName != LayerEvents.AddingRoad && eventName != LayerEvents.AddingLine) {
       stateService.clearEventName();
       stateService.clearEventName();
     } else if (eventName == LayerEvents.AddingRoad) {
     } else if (eventName == LayerEvents.AddingRoad) {
       stateService.setEventName(LayerEvents.AddRoad);
       stateService.setEventName(LayerEvents.AddRoad);
@@ -1475,57 +1328,23 @@ export default class Layer {
     let otherPoint1 = null;
     let otherPoint1 = null;
     let otherPoint2 = null;
     let otherPoint2 = null;
     if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedRoadPointIdX) {
     if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedRoadPointIdX) {
-      otherPoint1 = dataService.getRoadPoint(
-        listenLayer.modifyPoint.linkedRoadPointIdX
-      );
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedCurveRoadPointIdX
-    ) {
-      otherPoint1 = dataService.getCurveRoadPoint(
-        listenLayer.modifyPoint.linkedCurvePointIdX
-      );
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedPointIdX
-    ) {
-      otherPoint1 = dataService.getPoint(
-        listenLayer.modifyPoint.linkedPointIdX
-      );
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedCurvePointIdX
-    ) {
-      otherPoint1 = dataService.getCurvePoint(
-        listenLayer.modifyPoint.linkedCurvePointIdX
-      );
+      otherPoint1 = dataService.getRoadPoint(listenLayer.modifyPoint.linkedRoadPointIdX);
+    } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedCurveRoadPointIdX) {
+      otherPoint1 = dataService.getCurveRoadPoint(listenLayer.modifyPoint.linkedCurvePointIdX);
+    } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedPointIdX) {
+      otherPoint1 = dataService.getPoint(listenLayer.modifyPoint.linkedPointIdX);
+    } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedCurvePointIdX) {
+      otherPoint1 = dataService.getCurvePoint(listenLayer.modifyPoint.linkedCurvePointIdX);
     }
     }
 
 
     if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedRoadPointIdY) {
     if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedRoadPointIdY) {
-      otherPoint2 = dataService.getRoadPoint(
-        listenLayer.modifyPoint.linkedRoadPointIdY
-      );
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedCurvePointIdY
-    ) {
-      otherPoint2 = dataService.getCurveRoadPoint(
-        listenLayer.modifyPoint.linkedCurvePointIdY
-      );
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedPointIdY
-    ) {
-      otherPoint2 = dataService.getPoint(
-        listenLayer.modifyPoint.linkedPointIdY
-      );
-    } else if (
-      listenLayer.modifyPoint &&
-      listenLayer.modifyPoint.linkedCurvePointIdY
-    ) {
-      otherPoint2 = dataService.getCurvePoint(
-        listenLayer.modifyPoint.linkedCurvePointIdY
-      );
+      otherPoint2 = dataService.getRoadPoint(listenLayer.modifyPoint.linkedRoadPointIdY);
+    } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedCurvePointIdY) {
+      otherPoint2 = dataService.getCurveRoadPoint(listenLayer.modifyPoint.linkedCurvePointIdY);
+    } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedPointIdY) {
+      otherPoint2 = dataService.getPoint(listenLayer.modifyPoint.linkedPointIdY);
+    } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.linkedCurvePointIdY) {
+      otherPoint2 = dataService.getCurvePoint(listenLayer.modifyPoint.linkedCurvePointIdY);
     }
     }
 
 
     let otherPoint = {};
     let otherPoint = {};
@@ -1535,7 +1354,7 @@ export default class Layer {
     }
     }
     if (otherPoint2) {
     if (otherPoint2) {
       otherPoint.y = otherPoint2.y;
       otherPoint.y = otherPoint2.y;
-      if (!otherPoint.hasOwnProperty("x")) {
+      if (!otherPoint.hasOwnProperty('x')) {
         otherPoint.x = otherPoint2.x;
         otherPoint.x = otherPoint2.x;
       }
       }
     }
     }

+ 2 - 1
src/graphic/ListenLayer.js

@@ -887,7 +887,8 @@ export default class ListenLayer {
       const svg = dataService.getSVG(svgId);
       const svg = dataService.getSVG(svgId);
       for (let i = 0; i < svg.points.length; ++i) {
       for (let i = 0; i < svg.points.length; ++i) {
         let distance = this.getDistance(position, svg.points[i]);
         let distance = this.getDistance(position, svg.points[i]);
-        if (!svgInfo.svgId && distance < Constant.minAdsorbPix / 5) {
+        // if (!svgInfo.svgId && distance < Constant.minAdsorbPix / 5) { //改大图例四个点的选择范围
+        if (!svgInfo.svgId && distance < Constant.minAdsorbPix / 2) {
           svgInfo = {
           svgInfo = {
             svgId: svgId,
             svgId: svgId,
             distance: distance,
             distance: distance,

+ 78 - 3
src/graphic/Load.js

@@ -15,7 +15,7 @@ import { textService } from "./Service/TextService.js";
 import { svgService } from "./Service/SVGService.js";
 import { svgService } from "./Service/SVGService.js";
 import { mathUtil } from "./Util/MathUtil.js";
 import { mathUtil } from "./Util/MathUtil.js";
 import { historyService } from "./Service/HistoryService.js";
 import { historyService } from "./Service/HistoryService.js";
-
+import { uiService } from "./Service/UIService";
 export default class Load {
 export default class Load {
   constructor(layer) {
   constructor(layer) {
     this.layer = layer;
     this.layer = layer;
@@ -38,7 +38,8 @@ export default class Load {
           dataLocal.backgroundImg.vectorId
           dataLocal.backgroundImg.vectorId
         );
         );
         bgImg.setCenter(dataLocal.backgroundImg.center);
         bgImg.setCenter(dataLocal.backgroundImg.center);
-        bgImg.setDisplay(dataLocal.backgroundImg.display);
+        // bgImg.setDisplay(dataLocal.backgroundImg.display);
+        bgImg.setDisplay(true);//背景图始终显示
         bgImg.setAngle(dataLocal.backgroundImg.angle);
         bgImg.setAngle(dataLocal.backgroundImg.angle);
         try {
         try {
           if (dataLocal.backgroundImg.src) {
           if (dataLocal.backgroundImg.src) {
@@ -148,6 +149,52 @@ export default class Load {
           }
           }
         }
         }
       }
       }
+      // if (dataLocal.curvelines) {
+      //   for (let key in dataLocal.curvelines) {
+      //     let startPointId = dataLocal.curvelines[key].startId
+      //     let endPointId = dataLocal.curvelines[key].endId
+
+      //     let startPosition = null;
+      //     let endPosition = null ;
+      //     if(dataLocal.curvePoints){
+      //       startPosition ={ 
+      //         x:dataLocal.curvePoints[startPointId].x,
+      //         y:dataLocal.curvePoints[startPointId].y,
+      //       }
+      //       endPosition ={ 
+      //         x:dataLocal.curvePoints[endPointId].x,
+      //         y:dataLocal.curvePoints[endPointId].y,
+      //       }
+
+      //     }
+         
+      //     let curveline = lineService.createCurveLine(
+      //       startPosition,
+      //       endPosition,
+      //       dataLocal.curvelines[key].vectorId,
+      //     );
+
+      //     if (dataLocal.curvelines[key].style) {
+      //       curveline.setStyle(dataLocal.curvelines[key].style);
+      //     }
+      //     if (dataLocal.curvelines[key].weight) {
+      //       curveline.setWeight(dataLocal.curvelines[key].weight);
+      //     }
+      //     if (dataLocal.curvelines[key].color) {
+      //       curveline.setColor(dataLocal.curvelines[key].color);
+      //     }
+      //     if (dataLocal.curvelines[key].value) {
+      //       curveline.setValue(dataLocal.curvelines[key].value);
+      //     }
+      //     if (dataLocal.curvelines[key].locationMode) {
+      //       curveline.setLocationMode(dataLocal.curvelines[key].locationMode);
+      //     }
+      //     curveline.setDisplay(dataLocal.curvelines[key].display);
+      //     if (curveline.getCategory() == VectorCategory.Line.BaseLine) {
+      //       Settings.baseLineId = key;
+      //     }
+      //   }
+      // }
       if(dataLocal.roadPoints){
       if(dataLocal.roadPoints){
 
 
         for (let key in dataLocal.roadPoints) {
         for (let key in dataLocal.roadPoints) {
@@ -159,11 +206,39 @@ export default class Load {
       }
       }
       if(dataLocal.roads){
       if(dataLocal.roads){
         for (let key in dataLocal.roads) {
         for (let key in dataLocal.roads) {
+          uiService.setWayType(dataLocal.roads[key].way);
+          uiService.setSingleRoadDrivewayCount( dataLocal.roads[key].singleRoadDrivewayCount)
           let road = roadService.create(
           let road = roadService.create(
             dataLocal.roads[key].startId,
             dataLocal.roads[key].startId,
             dataLocal.roads[key].endId,
             dataLocal.roads[key].endId,
             dataLocal.roads[key].vectorId,
             dataLocal.roads[key].vectorId,
           );
           );
+          if(dataLocal.roadEdges){ //当roadEdge有样式的时候需要设置
+            for(let edgeKey in dataLocal.roadEdges){
+              let roadId = dataLocal.roadEdges[edgeKey].parent
+              if(roadId== key ){
+                for(let roadKey in dataLocal.roads[key]){
+                  if( roadKey == 'leftEdgeId' && dataLocal.roads[key][roadKey] == dataLocal.roadEdges[edgeKey].vectorId){
+                    let leftEdge = dataService.getRoadEdge(road.leftEdgeId);
+                    if(dataLocal.roadEdges[edgeKey].style){
+                      leftEdge.setStyle(dataLocal.roadEdges[edgeKey].style)
+                    }
+                    if(dataLocal.roadEdges[edgeKey].weight){
+                      leftEdge.setWeight(dataLocal.roadEdges[edgeKey].weight)
+                    }
+                  }else if(roadKey == 'rightEdgeId' && dataLocal.roads[key][roadKey] == dataLocal.roadEdges[edgeKey].vectorId){
+                    let rightEdge = dataService.getRoadEdge(road.rightEdgeId);
+                    if(dataLocal.roadEdges[edgeKey].style){
+                      rightEdge.setStyle(dataLocal.roadEdges[edgeKey].style)
+                    }
+                    if(dataLocal.roadEdges[edgeKey].weight){
+                      rightEdge.setWeight(dataLocal.roadEdges[edgeKey].weight)
+                    }
+                  }
+                }
+              }
+            }
+          }
         }
         }
       }
       }
       if(dataLocal.curveRoadPoints){
       if(dataLocal.curveRoadPoints){
@@ -307,7 +382,7 @@ export default class Load {
 
 
     const scale = res / (coordinate.zoom / coordinate.defaultZoom);
     const scale = res / (coordinate.zoom / coordinate.defaultZoom);
     dataService.setScale(scale);
     dataService.setScale(scale);
-    console.log(Settings)
+    console.log({...dataService.vectorData,Settings})
     return {...dataService.vectorData,Settings};
     return {...dataService.vectorData,Settings};
   }
   }
 
 

+ 6 - 0
src/graphic/Service/StateService.js

@@ -65,6 +65,9 @@ export default class StateService {
       return;
       return;
     } else if (this.draggingItem.type == VectorType.Line) {
     } else if (this.draggingItem.type == VectorType.Line) {
       const line = dataService.getLine(this.draggingItem.vectorId);
       const line = dataService.getLine(this.draggingItem.vectorId);
+      if(!line){
+        return 
+      }
       this.draggingItem.category = line.getCategory();
       this.draggingItem.category = line.getCategory();
     } else if (this.draggingItem.type == VectorType.Point) {
     } else if (this.draggingItem.type == VectorType.Point) {
       const point = dataService.getPoint(this.draggingItem.vectorId);
       const point = dataService.getPoint(this.draggingItem.vectorId);
@@ -86,6 +89,9 @@ export default class StateService {
       return;
       return;
     } else if (this.focusItem.type == VectorType.Line) {
     } else if (this.focusItem.type == VectorType.Line) {
       const line = dataService.getLine(this.focusItem.vectorId);
       const line = dataService.getLine(this.focusItem.vectorId);
+      if(!line){
+        return
+      }
       this.focusItem.category = line.getCategory();
       this.focusItem.category = line.getCategory();
     } else if (this.focusItem.type == VectorType.Point) {
     } else if (this.focusItem.type == VectorType.Point) {
       const point = dataService.getPoint(this.focusItem.vectorId);
       const point = dataService.getPoint(this.focusItem.vectorId);