[Commits] r797 - sandbox/bartvde/legend2/geoext/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Mon May 18 08:00:12 CEST 2009


Author: bartvde
Date: 2009-05-18 08:00:11 +0200 (Mon, 18 May 2009)
New Revision: 797

Modified:
   sandbox/bartvde/legend2/geoext/lib/GeoExt/widgets/MapPanel.js
Log:
part of the ticket:22 patch

Modified: sandbox/bartvde/legend2/geoext/lib/GeoExt/widgets/MapPanel.js
===================================================================
--- sandbox/bartvde/legend2/geoext/lib/GeoExt/widgets/MapPanel.js	2009-05-18 05:52:34 UTC (rev 796)
+++ sandbox/bartvde/legend2/geoext/lib/GeoExt/widgets/MapPanel.js	2009-05-18 06:00:11 UTC (rev 797)
@@ -182,5 +182,19 @@
     
 });
 
+/** api: function[guess]
+ *  :return: ``GeoExt.MapPanel`` The first map panel found by the Ext
+ *      component manager.
+ *  
+ *  Convenience function for guessing the map panel of an application. This
+ *     can reliably be used for all applications that just have one map panel
+ *     in the viewport.
+ */
+GeoExt.MapPanel.guess = function() {
+    return Ext.ComponentMgr.all.find(function(o) { 
+        return o instanceof GeoExt.MapPanel; 
+    }); 
+}
+
 /** api: xtype = gx_mappanel */
 Ext.reg('gx_mappanel', GeoExt.MapPanel); 



More information about the Commits mailing list