javascript – Autodesk Forge Markup – Simple line, possible utilising existing Polygon, Arrow or Rectangle
We’re currently looking to implement a simple straight line feature within document markup.
A straight line can be drawn currently by utilising the polygon tool and double clicking at the first point, however, we want to remove the ability of further clicks beyond the first.
I’ve looked to add a click event listener but it seems a bit of a messy approach.
I’ve looked at utilising the arrow tool, basically an arrow without the arrow head would do the trick, but I can’t seem to find a way of removing the arrow head. It looks to be calculated by the stroke width which I can’t unset that, as it’s used for the line.
I have found these styles, within markup.editor.styles.arrow, which I’ve tried to unset.
However, they look to be inherited and return to their original values.
Another option could be a rectangle of fixed height, but I guess for a line it’d be difficult to drag this diagonally.
Is there any known way, I can remove the arrow head from the Arrow tool, or force end the polygon tool after a single click?
Any help appreciated.
Many thanks.
Chrissy
Read more here: Source link