jinx 2 years ago
parent
commit
a08e0aae71
2 changed files with 7 additions and 2 deletions
  1. 3 1
      src/graphic/Service/RoadService.js
  2. 4 1
      src/graphic/Util/MathUtil.js

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

@@ -1578,8 +1578,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(
@@ -1608,6 +1609,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

@@ -1882,7 +1882,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;