#832 - changing the name of the second arg for the Feature.Vector constructor, mainly for documentation sake - note that this is not an api change - Feature.Vector inherits from Feature - Feature exposes a data property, Feature.Vector exposes an attributes property, both point to the same thing for Feature.Vector - this change does not alter that redundancy, only changes the argument names for the constructor - and adds tests - I'll leave the data/attributes property discussion for later

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3717 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-07-12 16:36:36 +00:00
parent 6bd7edf628
commit 51b31bc0a0
2 changed files with 22 additions and 9 deletions

View File

@@ -5,12 +5,22 @@
var map;
var feature;
function test_01_Feature_Vector_constructor (t) {
t.plan( 1 );
function test_Feature_Vector_constructor(t) {
t.plan(3);
var geometry = new OpenLayers.Geometry();
geometry.id = Math.random();
var style = {foo: "bar"};
var attributes = {bar: "foo"};
feature = new OpenLayers.Feature.Vector();
feature = new OpenLayers.Feature.Vector(geometry, attributes, style);
t.ok( feature instanceof OpenLayers.Feature.Vector, "new OpenLayers.Feature.Vector returns Feature.Vector object" );
t.ok(feature instanceof OpenLayers.Feature.Vector,
"new OpenLayers.Feature.Vector returns Feature.Vector object" );
t.eq(feature.attributes, attributes,
"attributes property set properly" );
t.eq(feature.geometry.id, geometry.id,
"geometry.property set properly" );
}