From 4be8f72afeb5f2cdc3fb3d472dd8c403b6747fd4 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Fri, 25 Feb 2011 07:25:03 +0000 Subject: [PATCH] Extending Map.js documentation to include comment regarding destroy from #2277. git-svn-id: http://svn.openlayers.org/trunk/openlayers@11454 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index b3cbf65fcf..ad64e54b02 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -643,7 +643,15 @@ OpenLayers.Map = OpenLayers.Class({ /** * 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