Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -3,35 +3,50 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* A Rectangle is a simple geometry. It is specified by a a point (x and y)
|
||||
* and dimensions (width and height), all of which are directly accessible as
|
||||
* properties.
|
||||
*
|
||||
* @requires OpenLayers/Geometry.js
|
||||
*
|
||||
* Class: OpenLayers.Geometry.Rectangle
|
||||
* A Rectangle is a simple geometry. It is specified by a a point (x and y)
|
||||
* and dimensions (width and height), all of which are directly accessible
|
||||
* as properties.
|
||||
*
|
||||
* Inherits:
|
||||
* - <OpenLayers.Geometry>
|
||||
*/
|
||||
|
||||
OpenLayers.Geometry.Rectangle = OpenLayers.Class.create();
|
||||
OpenLayers.Geometry.Rectangle.prototype =
|
||||
OpenLayers.Class.inherit(OpenLayers.Geometry, {
|
||||
|
||||
/** @type float */
|
||||
/**
|
||||
* Property: x
|
||||
* {Float}
|
||||
*/
|
||||
x: null,
|
||||
|
||||
/** @type float */
|
||||
/**
|
||||
* Property: y
|
||||
* {Float}
|
||||
*/
|
||||
y: null,
|
||||
|
||||
/** @type float */
|
||||
/**
|
||||
* Property: width
|
||||
* {Float}
|
||||
*/
|
||||
width: null,
|
||||
|
||||
/** @type float */
|
||||
/**
|
||||
* Property: height
|
||||
* {Float}
|
||||
*/
|
||||
height: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {array} points
|
||||
* Constructor: OpenLayers.Geometry.Rectangle
|
||||
*
|
||||
* Parameters:
|
||||
* points - {Array(<OpenLayers.Geometry.Point>}
|
||||
*/
|
||||
initialize: function(x, y, width, height) {
|
||||
OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
|
||||
@@ -44,7 +59,8 @@ OpenLayers.Geometry.Rectangle.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: calculateBounds
|
||||
* Recalculate the bounds for the geometry.
|
||||
*/
|
||||
calculateBounds: function() {
|
||||
this.bounds = new OpenLayers.Bounds(this.x, this.y,
|
||||
@@ -54,8 +70,10 @@ OpenLayers.Geometry.Rectangle.prototype =
|
||||
|
||||
|
||||
/**
|
||||
* @returns The length of the geometry
|
||||
* @type float
|
||||
* APIMethod: getLength
|
||||
*
|
||||
* Return:
|
||||
* {Float} The length of the geometry
|
||||
*/
|
||||
getLength: function() {
|
||||
var length = (2 * this.width) + (2 * this.height);
|
||||
@@ -63,8 +81,10 @@ OpenLayers.Geometry.Rectangle.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The area of the geometry
|
||||
* @type float
|
||||
* APIMethod: getArea
|
||||
*
|
||||
* Return:
|
||||
* {Float} The area of the geometry
|
||||
*/
|
||||
getArea: function() {
|
||||
var area = this.width * this.height;
|
||||
|
||||
Reference in New Issue
Block a user