Merge pull request #642 from marcjansen/api-docs
Better documentation. Non-functional change.
This commit is contained in:
@@ -416,5 +416,10 @@
|
||||
|
||||
/**
|
||||
* Constant: VERSION_NUMBER
|
||||
*
|
||||
* This constant identifies the version of OpenLayers.
|
||||
*
|
||||
* When asking questions or reporting issues, make sure to inlude the output of
|
||||
* OpenLayers.VERSION_NUMBER in the question or issue-description.
|
||||
*/
|
||||
OpenLayers.VERSION_NUMBER="Release 2.13 dev";
|
||||
|
||||
@@ -128,6 +128,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: toString
|
||||
* Returns a string representation of the bounds object.
|
||||
*
|
||||
* Returns:
|
||||
* {String} String representation of bounds object.
|
||||
@@ -138,6 +139,11 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: toArray
|
||||
* Returns an array representation of the bounds object.
|
||||
*
|
||||
* Returns an array of left, bottom, right, top properties, or -- when the
|
||||
* optional parameter is true -- an array of the bottom, left, top,
|
||||
* right properties.
|
||||
*
|
||||
* Parameters:
|
||||
* reverseAxisOrder - {Boolean} Should we reverse the axis order?
|
||||
@@ -155,6 +161,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: toBBOX
|
||||
* Returns a boundingbox-string representation of the bounds object.
|
||||
*
|
||||
* Parameters:
|
||||
* decimal - {Integer} How many significant digits in the bbox coords?
|
||||
@@ -163,7 +170,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
*
|
||||
* Returns:
|
||||
* {String} Simple String representation of bounds object.
|
||||
* (e.g. <i>"5,42,10,45"</i>)
|
||||
* (e.g. "5,42,10,45")
|
||||
*/
|
||||
toBBOX:function(decimal, reverseAxisOrder) {
|
||||
if (decimal== null) {
|
||||
@@ -202,9 +209,10 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getWidth
|
||||
* Returns the width of the bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {Float} The width of the bounds
|
||||
* {Float} The width of the bounds (right minus left).
|
||||
*/
|
||||
getWidth:function() {
|
||||
return (this.right - this.left);
|
||||
@@ -212,6 +220,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getHeight
|
||||
* Returns the height of the bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {Float} The height of the bounds (top minus bottom).
|
||||
@@ -222,9 +231,10 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getSize
|
||||
* Returns an <OpenLayers.Size> object of the bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Size>} The size of the box.
|
||||
* {<OpenLayers.Size>} The size of the bounds.
|
||||
*/
|
||||
getSize:function() {
|
||||
return new OpenLayers.Size(this.getWidth(), this.getHeight());
|
||||
@@ -232,6 +242,8 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getCenterPixel
|
||||
* Returns the <OpenLayers.Pixel> object which represents the center of the
|
||||
* bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Pixel>} The center of the bounds in pixel space.
|
||||
@@ -243,7 +255,9 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getCenterLonLat
|
||||
*
|
||||
* Returns the <OpenLayers.LonLat> object which represents the center of the
|
||||
* bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.LonLat>} The center of the bounds in map space.
|
||||
*/
|
||||
@@ -297,11 +311,24 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: add
|
||||
*
|
||||
* Shifts the coordinates of the bound by the given horizontal and vertical
|
||||
* deltas.
|
||||
*
|
||||
* (start code)
|
||||
* var bounds = new OpenLayers.Bounds(0, 0, 10, 10);
|
||||
* bounds.toString();
|
||||
* // => "0,0,10,10"
|
||||
*
|
||||
* bounds.add(-1.5, 4).toString();
|
||||
* // => "-1.5,4,8.5,14"
|
||||
* (end)
|
||||
*
|
||||
* This method will throw a TypeError if it is passed null as an argument.
|
||||
*
|
||||
* Parameters:
|
||||
* x - {Float}
|
||||
* y - {Float}
|
||||
*
|
||||
* x - {Float} horizontal delta
|
||||
* y - {Float} vertical delta
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Bounds>} A new bounds whose coordinates are the same as
|
||||
* this, but shifted by the passed-in x and y values.
|
||||
@@ -316,11 +343,16 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: extend
|
||||
* 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 LonLat, Point, or Bounds
|
||||
* Extend the bounds to include the <OpenLayers.LonLat>,
|
||||
* <OpenLayers.Geometry.Point> or <OpenLayers.Bounds> specified.
|
||||
*
|
||||
* Please note that this function assumes that left < right and
|
||||
* bottom < top.
|
||||
*
|
||||
* Parameters:
|
||||
* object - {<OpenLayers.LonLat>, <OpenLayers.Geometry.Point> or
|
||||
* <OpenLayers.Bounds>} The object to be included in the new bounds
|
||||
* object.
|
||||
*/
|
||||
extend:function(object) {
|
||||
var bounds = null;
|
||||
@@ -361,6 +393,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: containsLonLat
|
||||
* Returns whether the bounds object contains the given <OpenLayers.LonLat>.
|
||||
*
|
||||
* Parameters:
|
||||
* ll - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||
@@ -399,6 +432,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: containsPixel
|
||||
* Returns whether the bounds object contains the given <OpenLayers.Pixel>.
|
||||
*
|
||||
* Parameters:
|
||||
* px - {<OpenLayers.Pixel>}
|
||||
@@ -414,6 +448,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: contains
|
||||
* Returns whether the bounds object contains the given x and y.
|
||||
*
|
||||
* Parameters:
|
||||
* x - {Float}
|
||||
@@ -535,7 +570,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: containsBounds
|
||||
* Determine whether the target bounds is contained within this bounds.
|
||||
* Returns whether the bounds object contains the given <OpenLayers.Bounds>.
|
||||
*
|
||||
* bounds - {<OpenLayers.Bounds>} The target bounds.
|
||||
* partial - {Boolean} If any of the target corners is within this bounds
|
||||
@@ -565,10 +600,12 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: determineQuadrant
|
||||
*
|
||||
* Returns the the quadrant ("br", "tr", "tl", "bl") in which the given
|
||||
* <OpenLayers.LonLat> lies.
|
||||
*
|
||||
* Parameters:
|
||||
* lonlat - {<OpenLayers.LonLat>}
|
||||
*
|
||||
*
|
||||
* Returns:
|
||||
* {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the
|
||||
* coordinate lies.
|
||||
@@ -615,6 +652,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: wrapDateLine
|
||||
* Wraps the bounds object around the dateline.
|
||||
*
|
||||
* Parameters:
|
||||
* maxExtent - {<OpenLayers.Bounds>}
|
||||
@@ -681,12 +719,18 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
/**
|
||||
* APIFunction: fromString
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds from a
|
||||
* parameter string
|
||||
*
|
||||
* parameter string.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.fromString("5,42,10,45");
|
||||
* // => equivalent to ...
|
||||
* new OpenLayers.Bounds(5, 42, 10, 45);
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* str - {String}Comma-separated bounds string. (e.g. <i>"5,42,10,45"</i>)
|
||||
* str - {String} Comma-separated bounds string. (e.g. "5,42,10,45")
|
||||
* reverseAxisOrder - {Boolean} Does the string use reverse axis order?
|
||||
*
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Bounds>} New bounds object built from the
|
||||
* passed-in String.
|
||||
@@ -698,11 +742,16 @@ OpenLayers.Bounds.fromString = function(str, reverseAxisOrder) {
|
||||
|
||||
/**
|
||||
* APIFunction: fromArray
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds
|
||||
* from an array
|
||||
*
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds from an array.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.fromArray( [5, 42, 10, 45] );
|
||||
* // => equivalent to ...
|
||||
* new OpenLayers.Bounds(5, 42, 10, 45);
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* bbox - {Array(Float)} Array of bounds values (e.g. <i>[5,42,10,45]</i>)
|
||||
* bbox - {Array(Float)} Array of bounds values (e.g. [5,42,10,45])
|
||||
* reverseAxisOrder - {Boolean} Does the array use reverse axis order?
|
||||
*
|
||||
* Returns:
|
||||
@@ -716,12 +765,17 @@ OpenLayers.Bounds.fromArray = function(bbox, reverseAxisOrder) {
|
||||
|
||||
/**
|
||||
* APIFunction: fromSize
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds
|
||||
* from a size
|
||||
*
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds from a size.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.fromSize( new OpenLayers.Size(10, 20) );
|
||||
* // => equivalent to ...
|
||||
* new OpenLayers.Bounds(0, 20, 10, 0);
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* size - {<OpenLayers.Size>|Object} OpenLayers.Size or an object with
|
||||
* a 'w' and 'h' properties.
|
||||
* size - {<OpenLayers.Size> or Object} <OpenLayers.Size> or an object with
|
||||
* both 'w' and 'h' properties.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Bounds>} New bounds object built from the passed-in size.
|
||||
@@ -737,6 +791,14 @@ OpenLayers.Bounds.fromSize = function(size) {
|
||||
* Function: oppositeQuadrant
|
||||
* Get the opposite quadrant for a given quadrant string.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.oppositeQuadrant( "tl" );
|
||||
* // => "br"
|
||||
*
|
||||
* OpenLayers.Bounds.oppositeQuadrant( "tr" );
|
||||
* // => "bl"
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* quadrant - {String} two character quadrant shortstring
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user