add containsPixel() and containsLonLat() functions to OpenLayers.Bounds object. added tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1506 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -424,6 +424,30 @@ OpenLayers.Bounds.prototype = {
|
||||
this.right + x, this.top + y);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} ll
|
||||
* @param {Boolean} inclusive Whether or not to include the border.
|
||||
* Default is true
|
||||
*
|
||||
* @return Whether or not the passed-in lonlat is within this bounds
|
||||
* @type Boolean
|
||||
*/
|
||||
containsLonLat:function(ll, inclusive) {
|
||||
return this.contains(ll.lon, ll.lat, inclusive);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
* @param {Boolean} inclusive Whether or not to include the border.
|
||||
* Default is true
|
||||
*
|
||||
* @return Whether or not the passed-in pixel is within this bounds
|
||||
* @type Boolean
|
||||
*/
|
||||
containsPixel:function(px, inclusive) {
|
||||
return this.contains(px.x, px.y, inclusive);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} x
|
||||
* @param {float} y
|
||||
|
||||
Reference in New Issue
Block a user