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

Package | org.openscales.core.basetypes
Class | public class Bounds

Instances of this class represent bounding boxes. Data stored as left, bottom, right, top floats. All values are initialized to 0, however, you should make sure you set them before using the bounds for anything.

Public Properties

| Property | Defined by
--- | --- | ---
|  | bottom : Number | Bounds
|  | centerLonLat : LonLat [read-only] | Bounds
|  | centerPixel : Pixel [read-only] | Bounds
|  | height : Number [read-only] | Bounds
|  | left : Number | Bounds
|  | right : Number | Bounds
|  | size : Size [read-only] | Bounds
|  | top : Number | Bounds
|  | width : Number [read-only] | Bounds

Public Methods

| Method | Defined by
--- | --- | ---
|  | Bounds(left:Number, bottom:Number, right:Number, top:Number) Class constructor | Bounds
|  | add(x:Number, y:Number):Bounds | Bounds
|  | boundsToString(decimal:Number = -1):String Return a bbox string separating the bounds, with the decimal number passed as param, by commas. | Bounds
|  | clone():Bounds | Bounds
|  | containsBounds(bounds:Bounds, partial:Boolean = false, inclusive:Boolean = true):Boolean Returns if the current bounds contains the bounds passed as param | Bounds
|  | containsLonLat(ll:LonLat, inclusive:Boolean = true):Boolean Returns if the current bounds contains the LonLat passed as param | Bounds
|  | containsPixel(px:Pixel, inclusive:Boolean = true):Boolean Returns if the current bounds contains the Pixel passed as param | Bounds
|  | determineQuadrant(lonlat:LonLat):String Determines in which quadrant is placed the lonlat in relation to the current bounds. | Bounds
|  | equals(bounds:Bounds):Boolean Determines if the bounds passed as param is equal to current instance | Bounds
|  | extendFromBounds(bounds:Bounds):void Extends the current instance of Bounds from bounds. | Bounds
|  | extendFromLonLat(lonlat:LonLat):void Extends the current instance of Bounds from a LonLat. | Bounds
|  | getBBOXStringFromBounds(bounds:Bounds):String [static] Returns a bounds string from an instance of bounds | Bounds
|  | getBBOXStringFromUrl(url:String):String [static] Returns a bounds string from an url containing the bbox param | Bounds
|  | getBoundsFromArray(bbox:Array):Bounds [static] Returns a bounds instance from an array following this format: [left,bottom,right,top]. | Bounds
|  | getBoundsFromSize(size:Size):Bounds [static] Returns a bounds instance from a size instance. | Bounds
|  | getBoundsFromString(str:String):Bounds [static] Returns a bounds instance from a string following this format: "left,bottom,right,top". | Bounds
|  | intersectsBounds(bounds:Bounds, inclusive:Boolean = true):Boolean Determines if the bounds passed in param intersects the current bounds. | Bounds
|  | oppositeQuadrant(quadrant:String):String [static] Returns the opposite quadrant compared to the quadrant where is placed the lonlat in relation to the current bounds. | Bounds
|  | toGeometry():Polygon Create a new polygon geometry based on this bounds. | Bounds
|  | toString():String | Bounds
|  | transform(source:ProjProjection, dest:ProjProjection):void Method to convert the bounds from a projection system to an other. | Bounds

Property detail

bottom | property

`bottom:Number` [read-write]Implementation
`public function get bottom():Number`
`public function set bottom(value:Number):void`

centerLonLat | property |

`centerLonLat:LonLat` [read-only]Implementation
`public function get centerLonLat():LonLat`

centerPixel | property |

`centerPixel:Pixel` [read-only]Implementation
`public function get centerPixel():Pixel`

height | property |

`height:Number` [read-only]Implementation
`public function get height():Number`

left | property |

`left:Number` [read-write]Implementation
`public function get left():Number`
`public function set left(value:Number):void`

right | property |

`right:Number` [read-write]Implementation
`public function get right():Number`
`public function set right(value:Number):void`

size | property |

`size:Size` [read-only]Implementation
`public function get size():Size`

top | property |

`top:Number` [read-write]Implementation
`public function get top():Number`
`public function set top(value:Number):void`

width | property |

`width:Number` [read-only]Implementation
`public function get width():Number`
Constructor detail

Bounds | () | constructor

`public function Bounds(left:Number, bottom:Number, right:Number, top:Number)`

Class constructor

Parameters

| `left:Number` — Left bound of Bounds instance
| `bottom:Number` — Bottom bound of Bounds instance
| `right:Number` — Right bound of Bounds instance
| `top:Number` — Top bound of Bounds instance

Method detail

add | () | method

`public function add(x:Number, y:Number):Bounds` Parameters

| `x:Number`
| `y:Number`

Returns

| `Bounds`

boundsToString | () | method |

`public function boundsToString(decimal:Number = -1):String`

Return a bbox string separating the bounds, with the decimal number passed as param, by commas.

Parameters

| `decimal:Number` (default = `-1`)`` — Bounds number of decimals.

Returns

| `String` — The bounds separated by commas.

clone | () | method |

`public function clone():Bounds`

Returns

| `Bounds`

containsBounds | () | method |

`public function containsBounds(bounds:Bounds, partial:Boolean = false, inclusive:Boolean = true):Boolean`

Returns if the current bounds contains the bounds passed as param

Parameters

| `bounds:Bounds` — The bounds to check
| `partial:Boolean` (default = `false`)`` — Partial containing shoulds return true ?
| `inclusive:Boolean` (default = `true`)`` — It will include the border's bounds ?

Returns

| `Boolean` — Bounds are contained or not by the bounds

containsLonLat | () | method |

`public function containsLonLat(ll:LonLat, inclusive:Boolean = true):Boolean`

Returns if the current bounds contains the LonLat passed as param

Parameters

| `ll:LonLat` — The Lonlat to check
| `inclusive:Boolean` (default = `true`)`` — It will include the border's bounds ?

Returns

| `Boolean` — Lonlat is contained or not by the bounds

containsPixel | () | method |

`public function containsPixel(px:Pixel, inclusive:Boolean = true):Boolean`

Returns if the current bounds contains the Pixel passed as param

Parameters

| `px:Pixel` — The Pixel to check
| `inclusive:Boolean` (default = `true`)`` — It will include the border's bounds ?

Returns

| `Boolean` — Lonlat is contained or not by the bounds

determineQuadrant | () | method |

`public function determineQuadrant(lonlat:LonLat):String`

Determines in which quadrant is placed the lonlat in relation to the current bounds.

Parameters

| `lonlat:LonLat` — The lonlat we want to know the quadrant

Returns

| `String` — A string describing the quadrant (e.g. "bl" for Bottom-Left, "tr" for Top-Right etc.)

equals | () | method |

`public function equals(bounds:Bounds):Boolean`

Determines if the bounds passed as param is equal to current instance

Parameters

| `bounds:Bounds` — Bounds to check equality

Returns

| `Boolean` — It is equal or not

extendFromBounds | () | method |

`public function extendFromBounds(bounds:Bounds):void`

Extends the current instance of Bounds from bounds.

Parameters

| `bounds:Bounds` — The bounds which will extend the current bounds.

extendFromLonLat | () | method |

`public function extendFromLonLat(lonlat:LonLat):void`

Extends the current instance of Bounds from a LonLat.

Parameters

| `lonlat:LonLat` — The LonLat which will extend the bounds.

getBBOXStringFromBounds | () | method |

`public static function getBBOXStringFromBounds(bounds:Bounds):String`

Returns a bounds string from an instance of bounds

Parameters

| `bounds:Bounds` — The bounds from which we want a string

Returns

| `String` — A string describing the bounds.

getBBOXStringFromUrl | () | method |

`public static function getBBOXStringFromUrl(url:String):String`

Returns a bounds string from an url containing the bbox param

Parameters

| `url:String` — The url from which we want extract the bounds.

Returns

| `String` — A string describing the bounds contained by the url.

getBoundsFromArray | () | method |

`public static function getBoundsFromArray(bbox:Array):Bounds`

Returns a bounds instance from an array following this format: [left,bottom,right,top].

Parameters

| `bbox:Array` — The array from which we want create a bounds instance.

Returns

| `Bounds` — An instance of bounds.

getBoundsFromSize | () | method |

`public static function getBoundsFromSize(size:Size):Bounds`

Returns a bounds instance from a size instance.

Parameters

| `size:Size` — The size instance from which we want create a bounds instance.

Returns

| `Bounds` — An instance of bounds.

getBoundsFromString | () | method |

`public static function getBoundsFromString(str:String):Bounds`

Returns a bounds instance from a string following this format: "left,bottom,right,top".

Parameters

| `str:String` — The string from which we want create a bounds instance.

Returns

| `Bounds` — An instance of bounds.

intersectsBounds | () | method |

`public function intersectsBounds(bounds:Bounds, inclusive:Boolean = true):Boolean`

Determines if the bounds passed in param intersects the current bounds.

Parameters

| `bounds:Bounds` — The bounds to test intersection.
| `inclusive:Boolean` (default = `true`)`` — It will include the border's bounds ?

Returns

| `Boolean` — If the bounds intersects current bounds or not.

oppositeQuadrant | () | method |

`public static function oppositeQuadrant(quadrant:String):String`

Returns the opposite quadrant compared to the quadrant where is placed the lonlat in relation to the current bounds.

Parameters

| `quadrant:String` — The quadrant to opposite

Returns

| `String` — A string describing the opposite quadrant

toGeometry | () | method |

`public function toGeometry():Polygon`

Create a new polygon geometry based on this bounds.

Returns

| `Polygon` — A new polygon with the coordinates of this bounds.

toString | () | method |

`public function toString():String`

Returns

| `String`

transform | () | method |

`public function transform(source:ProjProjection, dest:ProjProjection):void`

Method to convert the bounds from a projection system to an other.

Parameters

| `source:ProjProjection` — The source projection
| `dest:ProjProjection` — The destination projection