Instances of this class represent bounding boxes.
NAME | DESCRIPTION |
---|---|
left | {Number} Minimum horizontal coordinate. |
bottom | {Number} Minimum vertical coordinate. |
right | {Number} Maximum horizontal coordinate. |
top | {Number} Maximum vertical coordinate. |
NAME | DESCRIPTION |
---|---|
ZOO.Bounds | Construct a new bounds object. |
clone | Create a cloned instance of this bounds. |
equals | Test a two bounds for equivalence. |
toString | {String} String representation of bounds object. |
toBBOX | |
toGeometry | Create a new polygon geometry based on this bounds. |
getWidth | {Float} The width of the bounds |
getHeight | {Float} The height of the bounds (top minus bottom) |
add | |
extend | Extend the bounds to include the point, lonlat, or bounds specified. |
intersectsBounds | Determine whether the target bounds intersects this bounds. |
containsBounds | Determine whether the target bounds is contained within this bounds. |
Properties
Functions
Construct a new bounds object.
Parameters
clone:function()
Create a cloned instance of this bounds.
Returns
{ZOO.Bounds} A fresh copy of the bounds
equals:function(bounds)
Test a two bounds for equivalence.
Parameters
Returns
{Boolean} The passed-in bounds object has the same left, right, top, bottom components as this. Note that if bounds passed in is null, returns false.
toString:function()
Returns
{String} String representation of bounds object. (ex. <i>”left-bottom=(5,42) right-top=(10,45)”</i>)
toBBOX:function(decimal)
Parameters
decimal {Integer} How many significant digits in the bbox coords? Default is 6
Returns
{String} Simple String representation of bounds object. (ex. <i>”5,42,10,45”</i>)
toGeometry: function()
Create a new polygon geometry based on this bounds.
Returns
{ZOO.Geometry.Polygon} A new polygon with the coordinates of this bounds.
getWidth:function()
Returns
{Float} The width of the bounds
getHeight:function()
Returns
{Float} The height of the bounds (top minus bottom).
add:function(x,y)
Parameters
Returns
{ZOO.Bounds} A new bounds whose coordinates are the same as this, but shifted by the passed-in x and y values.
extend:function(object)
Extend the bounds to include the point, lonlat, or bounds specified. Note, this function assumes that left < right and bottom < top.
Parameters
object {Object} Can be Point, or Bounds.
intersectsBounds:function(bounds,inclusive)
Determine whether the target bounds intersects this bounds. Bounds are considered intersecting if any of their edges intersect or if one bounds contains the other.
Parameters
Returns
{Boolean} The passed-in bounds object intersects this bounds.
containsBounds:function(bounds,partial,inclusive)
Determine whether the target bounds is contained within this bounds.
Parameters
Returns
{Boolean} The passed-in bounds object is contained within this bounds.