Handler to draw a polygon on the map. Polygon is displayed on mouse down, moves on mouse move, and is finished on mouse up.
| 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. |
Create a Polygon Handler.
| 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} |
Add temporary geometries
createFeature: function()
Destroy temporary geometries
destroyFeature: function()
Modify the existing geometry given the new point
modifyFeature: function()
Render geometries on the temporary layer.
drawFeature: function()
Return the sketch geometry.
getGeometry: function()
Handle double-clicks.
dblclick: function( evt )