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