Ticket #596: 596.patch
| File 596.patch, 0.9 kB (added by sderle, 2 years ago) |
|---|
-
lib/OpenLayers/Map.js
old new 243 243 this.unloadDestroy = null; 244 244 245 245 if (this.layers != null) { 246 for (var i=0; i< this.layers.length; i++) {246 for (var i = this.layers.length - 1; i>=0; --i) { 247 247 //pass 'false' to destroy so that map wont try to set a new 248 248 // baselayer after each baselayer is removed 249 249 this.layers[i].destroy(false); … … 251 251 this.layers = null; 252 252 } 253 253 if (this.controls != null) { 254 for (var i=0; i< this.controls.length; i++) {254 for (var i = this.controls.length - 1; i>=0; --i) { 255 255 this.controls[i].destroy(); 256 256 } 257 257 this.controls = null;
