OpenSpace. MapBoundsInstances of this class represent bounding boxes. Data stored as left, bottom, right, top floats. All values are initialized to null, however, you should make sure you set them before using the bounds for anything. Possible use casebounds = new OpenSpace.MapBounds(); bounds.extend(new OpenSpace.MapPoint(40,50)); bounds.extend(new OpenSpace.MapPoint(50,60)); bounds.toBBOX(); // returns 40,50,50,60
InheritsSummary | Instances of this class represent bounding boxes. | | | | {Number} The spatial reference system | | | | Construct a new map bounds object. | | | | {String} String representation of bounds object. | | {Array} array of left, bottom, right, top | | | | {Float} The width of the bounds | | {Float} The height of the bounds (top minus bottom). | | | | | | | | Extend the bounds to include the point, map point, or bounds specified. | | | | | | | | | | | | Alternative constructor that builds a new OpenLayers.Bounds from a parameter string | | Alternative constructor that builds a new OpenLayers.Bounds from an array | | Alternative constructor that builds a new OpenLayers.Bounds from a size |
srs{Number} The spatial reference system
OpenSpace. MapBoundsConstruct a new map bounds object. Parameters| left | {Float} The left bounds of the box. Note that for width calculations, this is assumed to be less than the right value. | | bottom | {Float} The bottom bounds of the box. Note that for height calculations, this is assumed to be more than the top value. | | right | {Float} The right bounds. | | top | {Float} The top bounds. |
toStringReturns{String} String representation of bounds object. (ex.<i>”left-bottom=(5,42) right-top=(10,45)”</i>)
toArrayReturns{Array} array of left, bottom, right, top
toBBOXParameters| 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>)
getWidthReturns{Float} The width of the bounds
getHeightReturns{Float} The height of the bounds (top minus bottom).
addParametersReturns{OpenSpace.MapBounds} A new bounds whose coordinates are the same as this, but shifted by the passed-in x and y values.
extendExtend the bounds to include the point, map point, or bounds specified. Note, this function assumes that left < right and bottom < top. Parameters| object | {Object} Can be MapPoint, Point, or Bounds |
containsLonLat| containsLonLat:function( | ll, | | inclusive | ) |
|
Parameters| ll | {OpenSpace.MapPoint} | | inclusive | {Boolean} Whether or not to include the border. Default is true. |
Returns{Boolean} The passed-in lonlat is within this bounds.
contains| contains:function( | x, | | y, | | inclusive | ) |
|
Parameters| x | {Float} | | y | {Float} | | inclusive | {Boolean} Whether or not to include the border. Default is true. |
Returns{Boolean} Whether or not the passed-in coordinates are within this bounds.
intersectsBounds| intersectsBounds:function( | bounds, | | inclusive | ) |
|
Parameters| bounds | {OpenLayers.Bounds} | | inclusive | {<Boolean>} Whether or not to include the border. Default is true. |
Returns{Boolean} The passed-in OpenLayers.Bounds object intersects this bounds. Simple math just check if either contains the other, allowing for partial.
containsBounds| containsBounds:function( | bounds, | | partial, | | inclusive | ) |
|
| bounds | {OpenLayers.Bounds} | | partial | {<Boolean>} If true, only part of passed-in bounds needs be within this bounds. If false, the entire passed-in bounds must be within. Default is false | | inclusive | {<Boolean>} Whether or not to include the border. Default is true. |
Returns{Boolean} The passed-in bounds object is contained within this bounds.
determineQuadrant| determineQuadrant: function( | lonlat | ) |
|
ParametersReturns{String} The quadrant (“br” “tr” “tl” “bl”) of the bounds in which the coordinate lies.
fromString| OpenSpace.MapBounds.fromString = function( | str | ) |
|
Alternative constructor that builds a new OpenLayers.Bounds from a parameter string Parameters| str | {String}Comma-separated bounds string. (ex. <i>”5,42,10,45”</i>) |
Returns{OpenSpace.MapBounds} New bounds object built from the passed-in String.
fromArray| OpenSpace.MapBounds.fromArray = function( | bbox | ) |
|
Alternative constructor that builds a new OpenLayers.Bounds from an array Parameters| bbox | {Array(Float)} Array of bounds values (ex. <i>[5,42,10,45]</i>) |
Returns{OpenSpace.MapBounds} New bounds object built from the passed-in Array.
fromSize| OpenSpace.MapBounds.fromSize = function( | size | ) |
|
Alternative constructor that builds a new OpenLayers.Bounds from a size ParametersReturns{OpenSpace.MapBounds} New bounds object built from the passed-in size.
|