#649 - remove collection.getComponents - use collection.components instead
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3032 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -70,14 +70,6 @@ OpenLayers.Geometry.Collection.prototype =
|
||||
return geometry;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns the components of the geometry
|
||||
* @type Array(OpenLayers.Geometry)
|
||||
*/
|
||||
getComponents: function(){
|
||||
return this.components;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns the components of the geometry
|
||||
* @type String
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
coll.addComponents(new OpenLayers.Geometry.Point(10,10));
|
||||
coll2 = coll.clone();
|
||||
t.ok( coll2 instanceof OpenLayers.Geometry.Collection, "coll.clone() returns collection object" );
|
||||
t.eq( coll2.getComponents().length, 2, "coll2.components.length is set correctly");
|
||||
t.eq( coll2.components.length, 2, "coll2.components.length is set correctly");
|
||||
t.ok( coll2.components[0] instanceof OpenLayers.Geometry.Point,
|
||||
"coll2.components.length is set correctly");
|
||||
}
|
||||
@@ -95,22 +95,13 @@
|
||||
coll.addComponents(point);
|
||||
coll.addComponents(new OpenLayers.Geometry.Point(10,10));
|
||||
coll.removeComponents(coll.components[0]);
|
||||
t.eq( coll.getComponents().length, 1, "coll.components.length is smaller after removeComponent" );
|
||||
t.eq( coll.components.length, 1, "coll.components.length is smaller after removeComponent" );
|
||||
t.ok( coll.bounds == null, "bounds are nullified after call to remove (to trigger recalc on getBounds()");
|
||||
bounds = coll.getBounds();
|
||||
t.eq( bounds.left, 10, "left bound is 10 after removeComponent" );
|
||||
t.eq( bounds.bottom, 10, "bottom bound is 10 after removeComponent" );
|
||||
}
|
||||
|
||||
function test_05_Collection_getComponents (t) {
|
||||
t.plan(1);
|
||||
|
||||
coll = new OpenLayers.Geometry.Collection();
|
||||
coll.components = {};
|
||||
|
||||
t.eq( coll.getComponents(), coll.components, "getComponents returns great");
|
||||
}
|
||||
|
||||
function test_06_Collection_calculateBounds(t) {
|
||||
t.plan( 9 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user