API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class DrawPolygonHandler

Package | org.openscales.core.handler.feature.draw
Class | public class DrawPolygonHandler
Inheritance | DrawPolygonHandler AbstractDrawHandler Handler

This handler manage the function draw of the polygon. Active this handler to draw a polygon.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | active : Boolean Getter and setter of the boolean defining the activity of the handler | Handler
|  | clickHandler : ClickHandler [read-only] Handler which manage the doubleClick, to finalize the polygon | DrawPolygonHandler
|  | drawLayer : FeatureLayer The layer concerned by the drawing Operation | AbstractDrawHandler
|  | firstPointRemoved : Boolean [read-only] his attribute is used to see a point the first time the user clicks | DrawPolygonHandler
|  | map : Map [write-only] | DrawPolygonHandler
|  | newFeature : Boolean To know if we create a new feature, or if some points are already added | DrawPolygonHandler
|  | toggleHandlerActivity : Function Getter and setter of the callback function used when the handler's activity changes | Handler

Public Methods

| Method | Defined by
--- | --- | ---
|  | DrawPolygonHandler(map:Map = null, active:Boolean = false, drawLayer:FeatureLayer = null) Constructor of the polygon handler | DrawPolygonHandler
|  | drawFinalPoly():void Finish the polygon | DrawPolygonHandler
|  | drawTemporaryPolygon(event:MouseEvent = null):void | DrawPolygonHandler
|  | mouseDblClick(LastPX:Pixel):void | DrawPolygonHandler

Protected Methods

| Method | Defined by
--- | --- | ---
|  | mouseClick(event:MouseEvent):void | DrawPolygonHandler
|  | registerListeners():void | DrawPolygonHandler
|  | unregisterListeners():void | DrawPolygonHandler

Property detail

clickHandler | property

`clickHandler:ClickHandler` [read-only]

Handler which manage the doubleClick, to finalize the polygon

Implementation
`public function get clickHandler():ClickHandler`

firstPointRemoved | property |

`firstPointRemoved:Boolean` [read-only]

his attribute is used to see a point the first time the user clicks

Implementation
`public function get firstPointRemoved():Boolean`

map | property |

`map:Map` [write-only]Implementation
`public function set map(value:Map):void`

newFeature | property |

`newFeature:Boolean` [read-write]

To know if we create a new feature, or if some points are already added

Implementation
`public function get newFeature():Boolean`
`public function set newFeature(value:Boolean):void`
Constructor detail

DrawPolygonHandler | () | constructor

`public function DrawPolygonHandler(map:Map = null, active:Boolean = false, drawLayer:FeatureLayer = null)`

Constructor of the polygon handler

Parameters

| `map:Map` (default = `null`)`` — the map reference
| `active:Boolean` (default = `false`)`` — determine if the handler is active or not
| `drawLayer:FeatureLayer` (default = `null`)`` — The layer on which we'll draw

Method detail

drawFinalPoly | () | method

`public function drawFinalPoly():void`

Finish the polygon

drawTemporaryPolygon | () | method |

`public function drawTemporaryPolygon(event:MouseEvent = null):void` Parameters

| `event:MouseEvent` (default = `null`)``

mouseClick | () | method |

`protected function mouseClick(event:MouseEvent):void` Parameters

| `event:MouseEvent`

mouseDblClick | () | method |

`public function mouseDblClick(LastPX:Pixel):void` Parameters

| `LastPX:Pixel`

registerListeners | () | method |

`protected override function registerListeners():void`

unregisterListeners | () | method |

`protected override function unregisterListeners():void`