|
@@ -1,10 +1,10 @@
|
|
|
-import VectorType from '../enum/VectorType.js';
|
|
|
-import Geometry from './Geometry.js';
|
|
|
-import Settings from '../Settings';
|
|
|
-import Constant from '../Constant';
|
|
|
-import { mathUtil } from '../Util/MathUtil.js';
|
|
|
-import { coordinate } from '../Coordinate.js';
|
|
|
-import { dataService } from '../Service/DataService.js';
|
|
|
+import VectorType from "../enum/VectorType.js";
|
|
|
+import Geometry from "./Geometry.js";
|
|
|
+import Settings from "../Settings";
|
|
|
+import Constant from "../Constant";
|
|
|
+import { mathUtil } from "../Util/MathUtil.js";
|
|
|
+import { coordinate } from "../Coordinate.js";
|
|
|
+import { dataService } from "../Service/DataService.js";
|
|
|
|
|
|
export default class Road extends Geometry {
|
|
|
constructor(startId, endId, vectorId) {
|
|
@@ -22,7 +22,7 @@ export default class Road extends Geometry {
|
|
|
this.midDivide = {
|
|
|
leftMidDivide: {},
|
|
|
rightMidDivide: {},
|
|
|
- midDivideWidth: Settings.roadMidDivideWidth,
|
|
|
+ midDivideWidth: Settings.roadMidDivideWidth * window.coordinate.ratio,
|
|
|
};
|
|
|
|
|
|
this.leftDrivewayCount = Settings.roadLeftDrivewayCount; //左边的车道个数
|
|
@@ -51,9 +51,9 @@ export default class Road extends Geometry {
|
|
|
|
|
|
setWidth(value, dir) {
|
|
|
if (this.way == Constant.twoWay) {
|
|
|
- if (dir == 'left') {
|
|
|
+ if (dir == "left") {
|
|
|
this.leftWidth = value;
|
|
|
- } else if (dir == 'right') {
|
|
|
+ } else if (dir == "right") {
|
|
|
this.rightWidth = value;
|
|
|
}
|
|
|
} else if (this.way == Constant.oneWay) {
|
|
@@ -72,7 +72,7 @@ export default class Road extends Geometry {
|
|
|
}
|
|
|
|
|
|
getPointId(dir) {
|
|
|
- if (dir == 'start') {
|
|
|
+ if (dir == "start") {
|
|
|
return this.startId;
|
|
|
} else {
|
|
|
return this.endId;
|
|
@@ -109,7 +109,7 @@ export default class Road extends Geometry {
|
|
|
if (this.way == Constant.oneWay) {
|
|
|
return this.singleRoadDrivewayCount;
|
|
|
} else if (this.way == Constant.twoWay) {
|
|
|
- if (dir == 'left') {
|
|
|
+ if (dir == "left") {
|
|
|
return this.leftDrivewayCount;
|
|
|
} else {
|
|
|
return this.rightDrivewayCount;
|
|
@@ -128,6 +128,4 @@ export default class Road extends Geometry {
|
|
|
setSingleLanes(singleLanes) {
|
|
|
this.singleLanes = JSON.parse(JSON.stringify(singleLanes));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|