#571: Don't subclass Geometry.Point from LonLat, and all neccesary associated

changes. Reviewed by tschaub (thx)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2943 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-03-31 18:30:56 +00:00
parent 45da80f8ad
commit 4aec64aa67
10 changed files with 67 additions and 110 deletions

View File

@@ -361,8 +361,8 @@
bounds.extend(object);
t.ok( ((bounds.left == object.lon) &&
(bounds.bottom == object.lat) &&
t.ok( ((bounds.left == object.x) &&
(bounds.bottom == object.y) &&
(bounds.right == originalBounds.right) &&
(bounds.top == originalBounds.top)), "obj Point to extends correclty modifies left and bottom");
@@ -375,8 +375,8 @@
t.ok( ((bounds.left == originalBounds.left) &&
(bounds.bottom == originalBounds.bottom) &&
(bounds.right == object.lon) &&
(bounds.top == object.lat)), "obj Point to extends correclty modifies right and top");
(bounds.right == object.x) &&
(bounds.top == object.y)), "obj Point to extends correclty modifies right and top");
}

View File

@@ -96,8 +96,8 @@
t.eq( curve.components.length, 4, "new point added to array" );
t.eq( bounds.bottom, -30, "bottom bound is -30 after 2nd addComponent" );
t.eq( bounds.left, -20, "left bound is 20 after 2nd addComponent" );
t.eq( curve.components[1].lon, -20, "new point.lon is -20 (index worked)" );
t.eq( curve.components[1].lat, -30, "new point.lat is -30 (index worked)" );
t.eq( curve.components[1].x, -20, "new point.lon is -20 (index worked)" );
t.eq( curve.components[1].y, -30, "new point.lat is -30 (index worked)" );
}
function test_05_Curve_removeComponent (t) {

View File

@@ -21,7 +21,7 @@
}
function test_02_MultiPoint_move(t) {
t.plan(4);
t.plan(2);
var multipoint = new OpenLayers.Geometry.MultiPoint([point]);
var x = point.x;
@@ -32,8 +32,6 @@
multipoint.move(dx, dy);
t.eq(multipoint.components[0].x, x + dx, "move() correctly modifies x");
t.eq(multipoint.components[0].y, y + dy, "move() correctly modifies y");
t.eq(multipoint.components[0].lon, x + dx, "move() correctly modifies lon");
t.eq(multipoint.components[0].lat, y + dy, "move() correctly modifies lat");
}
function test_MultiPoint_equals(t) {

View File

@@ -20,34 +20,10 @@
t.eq( point.CLASS_NAME, "OpenLayers.Geometry.Point", "point.CLASS_NAME is set correctly");
t.eq( point.x, x, "point.x is set correctly");
t.eq( point.y, y, "point.y is set correctly");
t.eq( point.lon, x, "point.lon is set correctly");
t.eq( point.lat, y, "point.lat is set correctly");
t.eq( point.lon, null, "point.lon is not set");
t.eq( point.lat, null, "point.lat is not set");
}
function test_02_Point_accessors(t) {
t.plan( 6 )
//valid
var x = 10;
var y = 20;
point = new OpenLayers.Geometry.Point(x, y);
t.eq( point.getX(), x, "point.x is get() correctly");
t.eq( point.getY(), y, "point.y is get() correctly");
var x1 = 55;
var y1 = 73;
point.setX(x1);
point.setY(y1);
t.eq( point.x, x1, "point.x is set() correctly");
t.eq( point.y, y1, "point.y is set() correctly");
t.eq( point.lon, x1, "point.lon is set() correctly");
t.eq( point.lat, y1, "point.lat is set() correctly");
}
function test_03_Point_calculateBounds (t) {
t.plan(4);
@@ -89,7 +65,7 @@
}
function test_06_Point_move(t) {
t.plan(4);
t.plan(2);
var x = 10;
var y = 20;
@@ -100,8 +76,6 @@
point.move(dx, dy);
t.eq(point.x, x + dx, "move() correctly modifies x");
t.eq(point.y, y + dy, "move() correctly modifies y");
t.eq(point.lon, x + dx, "move() correctly modifies lon");
t.eq(point.lat, y + dy, "move() correctly modifies lat");
}
function test_Point_equals(t) {