OpenLayers. Handler. Polygon

Handler to draw a polygon on the map.  Polygon is displayed on mouse down, moves on mouse move, and is finished on mouse up.

Inherits from

Summary
Handler to draw a polygon on the map.
Create a Polygon Handler.
Add temporary geometries
Destroy temporary geometries
Modify the existing geometry given the new point
Render geometries on the temporary layer.
Return a clone of the relevant geometry.
Handle double-clicks.

Constructor

OpenLayers. Handler. Polygon

Create a Polygon Handler.

Parameters

control{OpenLayers.Control}
callbacks{Object} An object with a ‘done’ property whos value is a function to be called when the path drawing is finished.  The callback should expect to recieve a single argument, the polygon geometry.  If the callbacks object contains a ‘point’ property, this function will be sent each point as they are added.  If the callbacks object contains a ‘cancel’ property, this function will be called when the handler is deactivated while drawing.  The cancel should expect to receive a geometry.
options{Object}

Functions

createFeature

createFeature: function()

Add temporary geometries

destroyFeature

destroyFeature: function()

Destroy temporary geometries

modifyFeature

modifyFeature: function()

Modify the existing geometry given the new point

drawFeature

drawFeature: function()

Render geometries on the temporary layer.

geometryClone

geometryClone: function()

Return a clone of the relevant geometry.

Returns

{OpenLayers.Geometry.Polygon}

dblclick

dblclick: function(evt)

Handle double-clicks.  Finish the geometry and send it back to the control.

Parameters

evt{Event}
createFeature: function()
Add temporary geometries
destroyFeature: function()
Destroy temporary geometries
modifyFeature: function()
Modify the existing geometry given the new point
drawFeature: function()
Render geometries on the temporary layer.
geometryClone: function()
Return a clone of the relevant geometry.
dblclick: function(evt)
Handle double-clicks.
Handler to draw a path on the map.
Base class to construct a higher-level handler for event sequences.
Controls affect the display or behavior of the map.
Polygon is a collection of Geometry.LinearRings.