I use openlayers and can draw lines using DrawFeature and OpenLayers.Handler.Path. Now I need to provide the ability to draw horizontal / vertical lines. This means that when the user starts to draw a line and moves the mouse at an angle, if the angle is less than 45 degrees along the x axis, he will only draw horizontally, and if the angle is more than 45 degrees, he will begin to draw vertical lines.
Any ideas on how to do this?
source share