[OpenLayers-Commits] r11454 - trunk/openlayers/lib/OpenLayers

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Fri Feb 25 02:25:03 EST 2011


Author: crschmidt
Date: 2011-02-24 23:25:03 -0800 (Thu, 24 Feb 2011)
New Revision: 11454

Modified:
   trunk/openlayers/lib/OpenLayers/Map.js
Log:
Extending Map.js documentation to include comment regarding destroy from
#2277.


Modified: trunk/openlayers/lib/OpenLayers/Map.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Map.js	2011-02-25 00:47:14 UTC (rev 11453)
+++ trunk/openlayers/lib/OpenLayers/Map.js	2011-02-25 07:25:03 UTC (rev 11454)
@@ -643,7 +643,15 @@
 
     /**
      * APIMethod: destroy
-     * Destroy this map
+     * Destroy this map.
+     *    Note that if you are using an application which removes a container
+     *    of the map from the DOM, you need to ensure that you destroy the
+     *    map *before* this happens; otherwise, the page unload handler
+     *    will fail because the DOM elements that map.destroy() wants
+     *    to clean up will be gone. (See 
+     *    http://trac.osgeo.org/openlayers/ticket/2277 for more information).
+     *    This will apply to GeoExt and also to other applications which
+     *    modify the DOM of the container of the OpenLayers Map.
      */
     destroy:function() {
         // if unloadDestroy is null, we've already been destroyed



More information about the Commits mailing list