add layer as first param to base OpenLayers.Feature class. Redo createMarker() and add createPopup(). Redo famous WFS loop so that now it just creates features (according to the feature class passed in) and stores those features in an array. update tests

git-svn-id: http://svn.openlayers.org/trunk/openlayers@407 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-26 23:00:28 +00:00
parent da27fafa98
commit 44760110bf
3 changed files with 81 additions and 60 deletions

View File

@@ -7,20 +7,25 @@
var feature, layer;
function test_01_Feature_constructor (t) {
t.plan( 5 );
t.plan( 6 );
var layer = new Object();
var id = "myfeature";
var lonlat = new OpenLayers.LonLat(2,1);
var iconURL = 'http://boston.openguides.org/features/ORANGE.png';
var iconSize = new OpenLayers.Size(12, 17);
var data = { iconURL: iconURL,
iconSize: iconSize
};
feature = new OpenLayers.Feature(layer, id, lonlat, data);
feature = new OpenLayers.Feature("myfeature",
new OpenLayers.LonLat(2,1),
{
iconURL:'http://boston.openguides.org/features/ORANGE.png',
iconW: 12,
iconH: 17
});
t.ok( feature instanceof OpenLayers.Feature, "new OpenLayers.Feature returns Feature object" );
t.ok( feature.lonlat instanceof OpenLayers.LonLat, "new feature.lonlat returns LonLat object" );
t.eq( feature.lonlat.lon, 2, "feature.lonlat.lon returns correct lon" );
t.eq( feature.lonlat.lat, 1, "feature.lonlat.lat returns correct lat" );
t.eq( feature.data.iconW, 12, "feature.data.iconW set correctly" );
t.eq( feature.layer, layer, "feature.layer set correctly" );
t.eq( feature.id, id, "feature.id set correctly" );
t.ok( feature.lonlat.equals(lonlat), "feature.lonlat set correctly" );
t.eq( feature.data.iconURL, iconURL, "feature.data.iconURL set correctly" );
t.ok( feature.data.iconSize.equals(iconSize), "feature.data.iconSize set correctly" );
}
function test_02_Feature_createMarker (t) {