add equals() function to OpenLayers.Bounds. plus test

git-svn-id: http://svn.openlayers.org/trunk/openlayers@389 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-26 02:42:58 +00:00
parent 1f89f13fb5
commit 75f9a6b2e0
2 changed files with 24 additions and 1 deletions

View File

@@ -267,6 +267,18 @@ OpenLayers.Bounds.prototype = {
this.right, this.top);
},
/**
* @param {OpenLayers.Bounds} bounds
* @returns Boolean value indicating whether the passed-in OpenLayers.Bounds
* object has the same left, right, top, bottom components as this
*
* @type bool
*/
equals:function(bounds) {
return ((this.left == bounds.left) && (this.right == bounds.right) &&
(this.top == bounds.top) && (this.bottom == bounds.bottom));
},
/**
* @return String representation of OpenLayers.Bounds object.
* (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>)