|
@@ -282,6 +282,7 @@ export default class Draw {
|
|
|
if (!isTemp && vector.display && vector.way !== "oneWay") {
|
|
|
const ctx = this.context;
|
|
|
const draw = (midDivide) => {
|
|
|
+ console.log(midDivide)
|
|
|
const startScreen = coordinate.getScreenXY(midDivide.start);
|
|
|
const endScreen = coordinate.getScreenXY(midDivide.end);
|
|
|
ctx.beginPath();
|
|
@@ -294,6 +295,7 @@ export default class Draw {
|
|
|
help.setVectorStyle(ctx, vector);
|
|
|
vector.midDivide.leftMidDivide && draw(vector.midDivide.leftMidDivide);
|
|
|
vector.midDivide.rightMidDivide && draw(vector.midDivide.rightMidDivide);
|
|
|
+
|
|
|
ctx.restore();
|
|
|
}
|
|
|
|
|
@@ -313,6 +315,7 @@ export default class Draw {
|
|
|
this.drawRoadEdge(vector, isTemp);
|
|
|
vector.leftLanes && vector.leftLanes.forEach(this.drawLan.bind(this));
|
|
|
vector.rightLanes && vector.rightLanes.forEach(this.drawLan.bind(this));
|
|
|
+ vector.singleLanes && vector.singleLanes.forEach(this.drawLan.bind(this));
|
|
|
}
|
|
|
|
|
|
drawLan(lan) {
|
|
@@ -669,6 +672,10 @@ export default class Draw {
|
|
|
|
|
|
if (vector.color) {
|
|
|
ctx.strokeStyle = vector.color;
|
|
|
+ style = {
|
|
|
+ ...style,
|
|
|
+ strokeStyle: vector.color
|
|
|
+ };
|
|
|
}
|
|
|
const draw = (style) => {
|
|
|
const radius = vector.radius || style.radius;
|
|
@@ -762,20 +769,24 @@ export default class Draw {
|
|
|
this.context.translate(points[0].x, points[0].y);
|
|
|
this.context.rotate(angle);
|
|
|
this.context.scale(width / svgWidth, height / svgHidth);
|
|
|
- const [style] = help.setVectorStyle(this.context, vector);
|
|
|
+ const [style, label] = help.setVectorStyle(this.context, vector);
|
|
|
this.context.lineWidth = style.lineWidth / (width / svgWidth);
|
|
|
- SVGIcons['chemotuoche_p.svg'].draw(this.context);
|
|
|
+ SVGIcons[vector.type].draw(this.context);
|
|
|
+ this.context.restore();
|
|
|
|
|
|
- if (import.meta.env.DEV) {
|
|
|
- this.context.restore();
|
|
|
+ if (label) {
|
|
|
+ this.context.save();
|
|
|
this.context.beginPath();
|
|
|
this.context.moveTo(points[0].x, points[0].y);
|
|
|
this.context.lineTo(points[1].x, points[1].y);
|
|
|
this.context.lineTo(points[2].x, points[2].y);
|
|
|
this.context.lineTo(points[3].x, points[3].y);
|
|
|
+ this.context.strokeStyle = "red"
|
|
|
+ this.context.setLineDash([6 * coordinate.ratio, 2 * coordinate.ratio]);
|
|
|
this.context.closePath();
|
|
|
this.context.stroke();
|
|
|
this.context.restore();
|
|
|
+ vector.points.forEach(point => this.drawPoint({...point, color: 'red', radius: 5 }))
|
|
|
}
|
|
|
}
|
|
|
|