when select feature control is destroyed and layers parameter was an array, the root container is not moved correctly, p=jorix, r=ahocevar,me (closes #2502)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10115 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2010-03-19 09:00:41 +00:00
parent 1757d4082e
commit c54dc76d15
2 changed files with 16 additions and 0 deletions

View File

@@ -233,6 +233,9 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
* Method: destroy
*/
destroy: function() {
if(this.active && this.layers) {
this.map.removeLayer(this.layer);
}
OpenLayers.Control.prototype.destroy.apply(this, arguments);
if(this.layers) {
this.layer.destroy();