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

@@ -161,7 +161,8 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
feature.originalStyle = feature.style;
}
this.layer.selectedFeatures.push(feature);
this.layer.drawFeature(feature, this.selectStyle);
feature.style = this.selectStyle;
this.layer.drawFeature(feature);
this.onSelect(feature);
},
@@ -175,10 +176,10 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
*/
unselect: function(feature) {
// Store feature style for restoration later
if(feature.originalStyle == null) {
feature.originalStyle = feature.style;
if(feature.originalStyle != null) {
feature.style = feature.originalStyle;
}
this.layer.drawFeature(feature, feature.originalStyle);
this.layer.drawFeature(feature);
OpenLayers.Util.removeItem(this.layer.selectedFeatures, feature);
this.onUnselect(feature);
},