Erik helps me fix tests. I threaten to kill him for criticizing my lack

of semicolons. All is well. Fix for "keep selected features drawn with 
the right style". (Closes #916)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@4232 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-09-12 05:12:00 +00:00
parent c519879391
commit 48a9da00ec
2 changed files with 20 additions and 4 deletions

View File

@@ -32,6 +32,21 @@
}
function test_Control_SelectFeature_select(t) {
t.plan(2);
var map = new OpenLayers.Map("map");
var layer = new OpenLayers.Layer.Vector();
map.addLayer(layer);
var control = new OpenLayers.Control.SelectFeature(layer);
var feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0,0));
layer.addFeatures(feature);
layer.drawFeature = function() { }
control.select(feature);
t.eq(feature.style.strokeColor, OpenLayers.Feature.Vector.style['select'].strokeColor, "feature style is set to select style");
control.unselect(feature);
t.eq(feature.style.strokeColor, OpenLayers.Feature.Vector.style['default'].strokeColor, "feature style is set back to old style");
}
function test_Control_SelectFeature_activate(t) {
t.plan(2);
var map = new OpenLayers.Map("map");