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:
@@ -53,12 +53,19 @@
|
||||
}
|
||||
|
||||
function test_04_Bounds_contains(t) {
|
||||
t.plan( 4 );
|
||||
t.plan( 6 );
|
||||
bounds = new OpenLayers.Bounds(10,10,40,40);
|
||||
t.eq( bounds.contains(20,20), true, "bounds(10,10,40,40) correctly contains LonLat(20,20)" );
|
||||
t.eq( bounds.contains(0,0), false, "bounds(10,10,40,40) correctly does not contain LonLat(0,0)" );
|
||||
t.eq( bounds.contains(40,40), true, "bounds(10,10,40,40) correctly contains LonLat(40,40) with inclusive set to true" );
|
||||
t.eq( bounds.contains(40,40, false), false, "bounds(10,10,40,40) correctly does not contain LonLat(40,40) with inclusive set to false" );
|
||||
|
||||
var px = new OpenLayers.Pixel(15,30);
|
||||
t.eq( bounds.containsPixel(px), bounds.contains(px.x, px.y), "containsPixel works");
|
||||
|
||||
var ll = new OpenLayers.LonLat(15,30);
|
||||
t.eq( bounds.containsLonLat(ll), bounds.contains(ll.lon, ll.lat), "containsLonLat works");
|
||||
|
||||
}
|
||||
|
||||
function test_05_Bounds_fromString(t) {
|
||||
|
||||
Reference in New Issue
Block a user