OpenLayers JavaScript Mapping Library |
OpenLayers. Handler. RegularPolygonHandler to draw a regular polygon on the map. Polygon is displayed on mouse down, moves or is modified on mouse move, and is finished on mouse up. The handler triggers callbacks for ‘done’ and ‘cancel’. Create a new instance with the OpenLayers.Handler.RegularPolygon constructor. Inherits fromSummary
snapToggle{String} If set, snapToggle is checked on mouse events and will set the snap mode to the opposite of what it currently is. To disallow toggling between snap and non-snap mode, set freehandToggle to null. Acceptable toggle values are ‘shiftKey’, ‘ctrlKey’, and ‘altKey’. Snap mode is only possible if this.snapAngle is set to a non-zero value. feature{OpenLayers.Feature.Vector} The currently drawn polygon feature layer{OpenLayers.Layer.Vector} The temporary drawing layer origin{OpenLayers.Geometry.Point} Location of the first mouse down OpenLayers. Handler. RegularPolygonCreate a new regular polygon handler. Parameters
calculateAngle
Calculate the angle based on settings. Parameters
callback
Trigger the control’s named callback with the given arguments Parameters
|
setOptions: function ( newOptions )
Turn on the handler.
activate: function()
Turn off the handler.
deactivate: function()
Respond to drag move events
move: function( evt )
Finish drawing the feature
up: function( evt )
Finish drawing the feature.
out: function( evt )
Create the new polygon geometry.
createGeometry: function()
Modify the polygon geometry in place.
modifyGeometry: function()
Calculate the angle based on settings.
calculateAngle: function( point, evt )
Finish the geometry and call the “cancel” callback.
cancel: function()
Finish the geometry and call the “done” callback.
finalize: function()
Clear any rendered features on the temporary layer.
clear: function()
Trigger the control’s named callback with the given arguments
callback: function ( name, args )