Demonstrates the use of editing methods for manipulating geometries while drawing.
control.insertXY method inserts a point at the given
map coordinates (x, y) immediately prior to the most recent point
(under the mouse).
control.insertDeltaXY method inserts a point at
the given offset values (dx, dy) from the previously added point.
control.insertDirectionLength method inserts a
point at offset direction and length from the previously added point.
Direction is measured counter-clockwise from the positive x-axis.
control.insertDeflectionLength method inserts a
point at offset deflection and length from the previously added point.
Deflection is measured counter-clockwise from the previous line
control.finishSketch method completes the current
sketch without adding the point under the user's mouse. This
allows a sketch to be finished without a double-click.
control.cancel method discards the current
sketch and leaves the control active.
control.insertXY method may be called before
any points are digitized manually. The other methods have no
effect until at least one point has been added to the sketch.
View the editing-methods.js source to see how this is done.