Here you go. I am rather uncertain how you all work together so pardon my blundering about.
http://trac.openlayers.org/ticket/1928 Cheers and Thanks, Paul From: Erik Uzureau [mailto:[email protected]] Sent: Wednesday, February 04, 2009 7:02 PM To: Paul Dziemiela Cc: dev >> openlayers Subject: Re: [OpenLayers-Dev] Destroying popups with abandon This looks great, Paul. Can you make a ticket and patch for this? :-) Erik On Wed, Feb 4, 2009 at 15:41, Paul Dziemiela <[email protected]> wrote: Hello, In some cases I need to "clear the decks" of popups and would like to simply blast away with the destroy() function anywhere that feature.popup is not null. However, when I try this against features that haven't actually created a popup I get several errors. Is it reasonable to expect destroy() to execute in any case without errors? The following changes would be needed to destroy() in Framed.js destroy: function() { this.imageSrc = null; this.imageSize = null; this.isAlphaImage = null; this.fixedRelativePosition = false; this.positionBlocks = null; //remove our blocks // Added this test if (this.blocks != null) { for(var i = 0; i < this.blocks.length; i++) { var block = this.blocks[i]; if (block.image) { block.div.removeChild(block.image); } block.image = null; if (block.div) { this.groupDiv.removeChild(block.div); } block.div = null; } } this.blocks = null; OpenLayers.Popup.Anchored.prototype.destroy.apply(this, arguments); }, And the following changes to destroy() in Popup.js destroy: function() { this.id = null; this.lonlat = null; this.size = null; this.contentHTML = null; this.backgroundColor = null; this.opacity = null; this.border = null; if (this.events != null) { this.events.destroy(); } this.events = null; if (this.closeDiv != null) { OpenLayers.Event.stopObservingElement(this.closeDiv); this.groupDiv.removeChild(this.closeDiv); } this.closeDiv = null; if (this.div != null) { this.div.removeChild(this.groupDiv); } this.groupDiv = null; if (this.map != null) { this.map.removePopup(this); } this.map = null; this.div = null; this.autoSize = null; this.minSize = null; this.maxSize = null; this.padding = null; this.panMapIfOutOfView = null; }, Thanks! Paul _______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
_______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
