"add a destroy() function that cycles through the kept references to the buttons and kills their circular refs" to the map object. Patch in #578 by euzuro
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2919 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -57,6 +57,19 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
|
|
||||||
return this.div;
|
return this.div;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
destroy: function() {
|
||||||
|
for( var btnId in this.buttons) {
|
||||||
|
var btn = this.buttons[btnId];
|
||||||
|
btn.map = null;
|
||||||
|
btn.events.destroy();
|
||||||
|
}
|
||||||
|
OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,
|
||||||
|
arguments);
|
||||||
|
},
|
||||||
|
|
||||||
_addButton:function(id, img, activeImg, xy, sz, title) {
|
_addButton:function(id, img, activeImg, xy, sz, title) {
|
||||||
var imgLocation = OpenLayers.Util.getImagesLocation() + img;
|
var imgLocation = OpenLayers.Util.getImagesLocation() + img;
|
||||||
|
|||||||
Reference in New Issue
Block a user