OpenLayers.Handler.Polygon - OpenLayers

# 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

- OpenLayers.Handler.Path
- OpenLayers.Handler

Summary

OpenLayers. Handler. Polygon | Handler to draw a polygon on the map.
Constructor |
OpenLayers. Handler. Polygon | Create a Polygon Handler.
Functions |
createFeature | Add temporary geometries
destroyFeature | Destroy temporary geometries
modifyFeature | Modify the existing geometry given the new point
drawFeature | Render geometries on the temporary layer.
getGeometry | Return the sketch geometry.
dblclick | 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.

### getGeometry

> getGeometry: function()

Return the sketch geometry. If <multi> is true, this will return a multi-part 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.

> getGeometry: function()

Return the sketch 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.
Close