I have learned a Draw object in Openlayers.
I try to draw the dotted line when user moves the mouse. When user clicks the last and prev lines should be replaced on straight line.
How does it work, should I use two different drawing ayers and switch between them?
Or I can retrieve a last line from draw object and redraw it on straight line?
I try to use this sample from official document:
https://openlayers.org/en/latest/examples/measure-style.html