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

Package | org.openscales.core.handler.feature
Class | public class SelectFeaturesHandler
Inheritance | SelectFeaturesHandler ClickHandler Handler

Select Features by clicking, by drawing a selection box or by drawing a freehand selection area. If the CTRL key is pressed, the previous selection is not cleared and the new selection is added. If the SHIFT key is pressed, the previous selection is not cleared and the new selection is removed. A click on a selected feature unselect it.

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
|  | click : Function Click function getter and setter | ClickHandler
|  | doubleClick : Function Double click function getter and setter | ClickHandler
|  | drag : Function Drag function getter and setter | ClickHandler
|  | drop : Function Drop function getter and setter | ClickHandler
|  | enableBoxSelection : Boolean [write-only] | SelectFeaturesHandler
|  | enableClickSelection : Boolean [write-only] | SelectFeaturesHandler
|  | enableOverSelection : Boolean [write-only] | SelectFeaturesHandler
|  | layers : Array Layers array getter and setter | SelectFeaturesHandler
|  | map : Map [write-only] Set the map associated to the handler. | SelectFeaturesHandler
|  | onOutFeature : Function On out feature function getter and setter | SelectFeaturesHandler
|  | onOverFeature : Function On over feature function getter and setter | SelectFeaturesHandler
|  | onSelectedFeature : Function On selected feature function getter and setter | SelectFeaturesHandler
|  | onSelectionUpdated : Function On selection updated function getter and setter | SelectFeaturesHandler
|  | onUnselectedFeature : Function On unselected feature function getter and setter | SelectFeaturesHandler
|  | selectedFeatures : Array [read-only] Array of the selected features | SelectFeaturesHandler
|  | selectedStyle : Function selectedStyle function getter and setter | SelectFeaturesHandler
|  | selectionAreaBorderColor : uint Selection geometry's border color getter and setter | SelectFeaturesHandler
|  | selectionAreaBorderThin : Number Selection geometry's border thin getter and setter | SelectFeaturesHandler
|  | selectionAreaFillColor : uint Selection geometry's fill color getter and setter | SelectFeaturesHandler
|  | selectionAreaFillOpacity : Number Selection geometry's fill opacity thin getter and setter | SelectFeaturesHandler
|  | selectionBuffer : Number Selection buffer getter and setter | SelectFeaturesHandler
|  | toggleHandlerActivity : Function Getter and setter of the callback function used when the handler's activity changes | Handler
|  | unselectableFeatures : Array unselectableFeatures array getter and setter | SelectFeaturesHandler

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined by
--- | --- | ---
|  | _ctrlKey : Boolean = false CTRL is pressed ? | ClickHandler
|  | _downPixel : Pixel = null Pixel under the cursor when the mouse is down | ClickHandler
|  | _dragging : Boolean = false | ClickHandler
|  | _shiftKey : Boolean = false SHIFT is pressed ? | ClickHandler
|  | _upPixel : Pixel = null Pixel under the cursor when the mouse is up | ClickHandler

Public Methods

| Method | Defined by
--- | --- | ---
|  | SelectFeaturesHandler(map:Map = null, active:Boolean = false, enableClickSelection:Boolean = true, enableBoxSelection:Boolean = true, enableOverSelection:Boolean = false) Constructor of the handler. | SelectFeaturesHandler
|  | clearSelection():void Clear the current selection. | SelectFeaturesHandler
|  | defaultSelectedStyle(feature:Feature):Style [static] Default style used for a selected feature. | SelectFeaturesHandler

Protected Methods
Hide Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined by
--- | --- | ---
|  | mouseDown(evt:MouseEvent):void The MouseDown Listener | ClickHandler
|  | mouseMove(evt:MouseEvent):void The MouseMove Listener | ClickHandler
|  | mouseUp(evt:MouseEvent):void MouseUp Listener | ClickHandler
|  | registerListeners():void Add the listeners to the associated map | SelectFeaturesHandler
|  | selectionBoxCoordinates(p:Pixel, buffer:Number = 0):Bounds The select box, in map's coordinates, defining by the point clicked at the beginning of the drag (mouseDown) and the point where the mouseUp event occurs. | ClickHandler
|  | selectionBoxPixels(p:Pixel, buffer:Number = 0):Rectangle The select box, in pixels, defining by the pixel clicked at the beginning of the drag (mouseDown) and the pixel where the mouseUp event occurs. | ClickHandler
|  | startCoordinates():LonLat Map coordinates (in its baselayer's SRS) of the point clicked (at the beginning of the drag) | ClickHandler
|  | unregisterListeners():void Remove the listeners to the associated map | SelectFeaturesHandler

Property detail

enableBoxSelection | property

`enableBoxSelection:Boolean` [write-only]Implementation
`public function set enableBoxSelection(value:Boolean):void`

enableClickSelection | property |

`enableClickSelection:Boolean` [write-only]Implementation
`public function set enableClickSelection(value:Boolean):void`

enableOverSelection | property |

`enableOverSelection:Boolean` [write-only]Implementation
`public function set enableOverSelection(value:Boolean):void`

layers | property |

`layers:Array` [read-write]

Layers array getter and setter

Implementation
`public function get layers():Array`
`public function set layers(value:Array):void`

map | property |

`map:Map` [write-only]

Set the map associated to the handler. The current selection is cleared and the array of the layers to treat is reset to a void array.

Implementation
`public function set map(value:Map):void`

onOutFeature | property |

`onOutFeature:Function` [read-write]

On out feature function getter and setter

Implementation
`public function get onOutFeature():Function`
`public function set onOutFeature(value:Function):void`

onOverFeature | property |

`onOverFeature:Function` [read-write]

On over feature function getter and setter

Implementation
`public function get onOverFeature():Function`
`public function set onOverFeature(value:Function):void`

onSelectedFeature | property |

`onSelectedFeature:Function` [read-write]

On selected feature function getter and setter

Implementation
`public function get onSelectedFeature():Function`
`public function set onSelectedFeature(value:Function):void`

onSelectionUpdated | property |

`onSelectionUpdated:Function` [read-write]

On selection updated function getter and setter

Implementation
`public function get onSelectionUpdated():Function`
`public function set onSelectionUpdated(value:Function):void`

onUnselectedFeature | property |

`onUnselectedFeature:Function` [read-write]

On unselected feature function getter and setter

Implementation
`public function get onUnselectedFeature():Function`
`public function set onUnselectedFeature(value:Function):void`

selectedFeatures | property |

`selectedFeatures:Array` [read-only]

Array of the selected features

Implementation
`public function get selectedFeatures():Array`

selectedStyle | property |

`selectedStyle:Function` [read-write]

selectedStyle function getter and setter

Implementation
`public function get selectedStyle():Function`
`public function set selectedStyle(value:Function):void`

selectionAreaBorderColor | property |

`selectionAreaBorderColor:uint` [read-write]

Selection geometry's border color getter and setter

Implementation
`public function get selectionAreaBorderColor():uint`
`public function set selectionAreaBorderColor(value:uint):void`

selectionAreaBorderThin | property |

`selectionAreaBorderThin:Number` [read-write]

Selection geometry's border thin getter and setter

Implementation
`public function get selectionAreaBorderThin():Number`
`public function set selectionAreaBorderThin(value:Number):void`

selectionAreaFillColor | property |

`selectionAreaFillColor:uint` [read-write]

Selection geometry's fill color getter and setter

Implementation
`public function get selectionAreaFillColor():uint`
`public function set selectionAreaFillColor(value:uint):void`

selectionAreaFillOpacity | property |

`selectionAreaFillOpacity:Number` [read-write]

Selection geometry's fill opacity thin getter and setter

Implementation
`public function get selectionAreaFillOpacity():Number`
`public function set selectionAreaFillOpacity(value:Number):void`

selectionBuffer | property |

`selectionBuffer:Number` [read-write]

Selection buffer getter and setter

Implementation
`public function get selectionBuffer():Number`
`public function set selectionBuffer(value:Number):void`

unselectableFeatures | property |

`unselectableFeatures:Array` [read-write]

unselectableFeatures array getter and setter

Implementation
`public function get unselectableFeatures():Array`
`public function set unselectableFeatures(value:Array):void`
Constructor detail

SelectFeaturesHandler | () | constructor

`public function SelectFeaturesHandler(map:Map = null, active:Boolean = false, enableClickSelection:Boolean = true, enableBoxSelection:Boolean = true, enableOverSelection:Boolean = false)`

Constructor of the handler.

Parameters

| `map:Map` (default = `null`)`` — the map associated to the handler
| `active:Boolean` (default = `false`)`` — boolean defining if the handler is active or not
| `enableClickSelection:Boolean` (default = `true`)``
| `enableBoxSelection:Boolean` (default = `true`)``
| `enableOverSelection:Boolean` (default = `false`)``

Method detail

clearSelection | () | method

`public function clearSelection():void`

Clear the current selection.

defaultSelectedStyle | () | method |

`public static function defaultSelectedStyle(feature:Feature):Style`

Default style used for a selected feature. The style depends on the type of the input feature (point, multipoint, linestring, multilinestring, polygon, multipolygon).

Parameters

| `feature:Feature`

Returns

| `Style`

registerListeners | () | method |

`protected override function registerListeners():void`

Add the listeners to the associated map

unregisterListeners | () | method |

`protected override function unregisterListeners():void`

Remove the listeners to the associated map