We had Calculated the angle by using this code for the marker line to be drawn
let angle = Math.atan2( nextdata.y - y, nextdata.x - x ) * ( 180 / Math.PI )
let xOffset = 2;
let yOffset = 0;
ctx.fillText("", x - (xOffset), y - (yOffset));
ctx.strokeStyle = "rgb(161, 167, 179)";
ctx.fillStyle = "white";
ctx.beginPath();
ctx.lineTo(x, y);
//todo_updated point
ctx.lineTo(x + 8, y);
ctx.stroke();
ctx.fill();
based on the angle how to rotate the drawn line ?
Hello Umer,
The “ctx” object in your marker template in this case is of the type CanvasRenderingContext2D. This is a web API element that you can read about here: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D. Note that this element has a rotate method that you should be able to use in this case.
Please let me know if you have any other questions or concerns on this matter.