瀏覽代碼

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

xushiting 2 年之前
父節點
當前提交
8c7d70c9ea
共有 2 個文件被更改,包括 7 次插入2 次删除
  1. 3 1
      src/graphic/Service/RoadService.js
  2. 4 1
      src/graphic/Util/MathUtil.js

+ 3 - 1
src/graphic/Service/RoadService.js

@@ -1567,8 +1567,9 @@ export default class RoadService {
     let edgeLine = mathUtil.createLine1(leftEdgePoint, rightEdgePoint);
     let roadWidthTipsPos = [];
     if (road.way == Constant.oneWay) {
-      //单车道
+      //单
       if (road.singleLanes.length) {
+        //单向多车道
         let crossList = [];
         for (let i = 0; i < road.singleLanes.length; i++) {
           let crossLine = mathUtil.createLine1(
@@ -1597,6 +1598,7 @@ export default class RoadService {
         });
         road.setRoadWidthTipsPos(roadWidthTipsPos);
       } else {
+          //单向单车道
         roadWidthTipsPos.push({ start: leftEdgePoint, end: rightEdgePoint });
         road.setRoadWidthTipsPos(roadWidthTipsPos);
       }

+ 4 - 1
src/graphic/Util/MathUtil.js

@@ -1912,7 +1912,10 @@ export default class MathUtil {
    * @param {*} targetPointDistance  //目标点到终点的距离
    * @returns
    */
-  getLinePointPos(startPoint, endPoint, targetPointDistance = 100) {
+  getLinePointPos(startPoint, endPoint, targetPointDistance) {
+    if(!targetPointDistance){
+      targetPointDistance = Constant.roadWidthTipsDistance
+    }
     let lineLength = this.getDistance(startPoint, endPoint);
 
     var ratio = 1;