add Bounds.intersectsBounds() function and tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1529 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -474,7 +474,27 @@ OpenLayers.Bounds.prototype = {
|
||||
}
|
||||
return contains;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} inclusive Whether or not to include the border.
|
||||
* Default is true
|
||||
*
|
||||
* @return Whether or not the passed-in OpenLayers.Bounds object intersects
|
||||
* this bounds. Simple math just check if either contains the other,
|
||||
* allowing for partial.
|
||||
* @type Boolean
|
||||
*/
|
||||
intersectsBounds:function(bounds, inclusive) {
|
||||
|
||||
if (inclusive == null) {
|
||||
inclusive = true;
|
||||
}
|
||||
|
||||
return (this.containsBounds(bounds, true, inclusive) ||
|
||||
bounds.containsBounds(this, true, inclusive));
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} partial If true, only part of passed-in
|
||||
|
||||
Reference in New Issue
Block a user