|
|
@@ -245,18 +245,27 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
- if (this.hasRange && this.mapPointInfo.z) {
|
|
|
+ if (this.hasRange && this.mapPointInfo.angle) {
|
|
|
var img2 = new Image();
|
|
|
img2.src = require('../assets/fangxiang.png');
|
|
|
img2.onload = () => {
|
|
|
+ ctx.moveTo(x * width + width / 2, y * height + height / 2);
|
|
|
+ ctx.lineTo(x * width + width / 2+50, y * height + height / 2);
|
|
|
+ ctx.setLineDash([5,5]);
|
|
|
+ ctx.lineWidth =2;
|
|
|
+ ctx.strokeStyle = 'rgb(0,0,0,0.5)';
|
|
|
+ ctx.stroke();
|
|
|
+ ctx.setLineDash([5,0]);
|
|
|
+ ctx.lineWidth =1;
|
|
|
ctx.translate(x * width + width / 2, y * height + height / 2);
|
|
|
- ctx.rotate(Number(this.mapPointInfo.z) * Math.PI / 180);
|
|
|
- ctx.drawImage(img2, -8, -60)
|
|
|
- ctx.rotate(- Number(this.mapPointInfo.z) * Math.PI / 180);
|
|
|
+ ctx.rotate(-Number(this.mapPointInfo.angle) * Math.PI / 180);
|
|
|
+ ctx.drawImage(img2, 0, -8)
|
|
|
+ ctx.rotate(Number(this.mapPointInfo.angle) * Math.PI / 180);
|
|
|
ctx.translate(-x * width - width / 2, -y * height - height / 2);
|
|
|
ctx.font = "14px 微软雅黑";
|
|
|
ctx.fillStyle = 'red';
|
|
|
- ctx.fillText(Number(this.mapPointInfo.z), x*width+16,y*height+5,100);
|
|
|
+ ctx.fillText(Number(this.mapPointInfo.angle), x * width + 20, y * height + 5, 100);
|
|
|
+ ctx.fillText(Number(this.mapPointInfo.angle), x * width + 20+0.5, y * height + 5+0.5, 100);
|
|
|
}
|
|
|
}
|
|
|
}
|