The DrawFeature control draws point, line or polygon features on a vector layer when active.

Summary

OpenLayers. | The DrawFeature control draws point, line or polygon features on a vector layer when active. |

Constants | |

EVENT_TYPES | |

Properties | |

multi | {Boolean} Cast features to multi-part geometries before passing to the layer. |

featureAdded | {Function} Called after each feature is added |

handlerOptions | {Object} Used to set non-default properties on the control’s handler |

Constructor | |

OpenLayers. | |

Functions | |

insertXY | Insert a point in the current sketch given x & y coordinates. |

insertDeltaXY | Insert a point given offsets from the previously inserted point. |

insertDirectionLength | Insert a point in the current sketch given a direction and a length. |

insertDeflectionLength | Insert a point in the current sketch given a deflection and a length. |

undo | Remove the most recently added point in the current sketch geometry. |

redo | Reinsert the most recently removed point resulting from an undo call. |

finishSketch | Finishes the sketch without including the currently drawn point. |

cancel | Cancel the current sketch. |

layer | {OpenLayers.Layer.Vector} |

handler | {OpenLayers.Handler} |

options | {Object} |

insertDeflectionLength: function( deflection, length )

Insert a point in the current sketch given a deflection and a length. The deflection should be degrees clockwise from the previously digitized segment.

deflection | {Number} Degrees clockwise from the previous segment. |

length | {Number} Distance from the previously drawn point. |

redo: function()

Reinsert the most recently removed point resulting from an undo call. The undo stack is deleted whenever a point is added by other means.

{Boolean} An edit was redone.

OpenLayers

JavaScript Mapping Library

OpenLayers

Insert a point in the current sketch given x & y coordinates.

insertXY: function( x, y )

Insert a point given offsets from the previously inserted point.

insertDeltaXY: function( dx, dy )

Insert a point in the current sketch given a direction and a length.

insertDirectionLength: function( direction, length )

Insert a point in the current sketch given a deflection and a length.

insertDeflectionLength: function( deflection, length )

Remove the most recently added point in the current sketch geometry.

undo: function()

Reinsert the most recently removed point resulting from an undo call.

redo: function()

Finishes the sketch without including the currently drawn point.

finishSketch: function()

Cancel the current sketch.

cancel: function()

Controls affect the display or behavior of the map.

Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.

Base class to construct a higher-level handler for event sequences.