Reverting changes from r8664 that were inadvertently committed to the trunk. This gets the SelectFeature control tests passing again. (see #1666)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8675 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-01-15 21:30:39 +00:00
parent 34599e7f50
commit 37cca38958

View File

@@ -11,7 +11,7 @@
var control = new OpenLayers.Control.SelectFeature(layer, options);
t.ok(control instanceof OpenLayers.Control.SelectFeature,
"new OpenLayers.Control.SelectFeature returns an instance");
t.eq(control.layers[0], "bar",
t.eq(control.layer, "bar",
"constructor sets layer correctly");
// t.eq(control.handlers.feature.geometryTypes, "foo",
// "constructor sets options correctly on feature handler");
@@ -74,15 +74,14 @@
features[i] = {
id: Math.random(),
tested: 0,
style: "",
layer: layer
style: ""
};
}
// test that onSelect gets called properly
control.onSelect = function(feature) {
feature.tested += 1;
t.eq(feature.id, features[feature.index].id,
t.eq(feature, features[feature.index],
"onSelect called with proper feature (" + feature.index + ")");
t.eq(feature.tested, feature.test,
"onSelect called only once for feature (" + feature.index + ")");
@@ -91,7 +90,7 @@
// test that onUnselect gets called properly
control.onUnselect = function(feature) {
feature.tested += 1;
t.eq(feature.id, features[feature.index].id,
t.eq(feature, features[feature.index],
"onUnselect called with proper feature (" + feature.index + ")");
t.eq(feature.tested, feature.test,
"onUnselect called only once for feature (" + feature.index + ")");