[Commits] r2781 - in sandbox/gxm/geoext/gxm/lib/GXM: data data/models widgets

commits at geoext.org commits at geoext.org
Mon Jul 25 00:56:19 CEST 2011


Author: marcjansen
Date: 2011-07-25 00:56:18 +0200 (Mon, 25 Jul 2011)
New Revision: 2781

Modified:
   sandbox/gxm/geoext/gxm/lib/GXM/data/LayerReader.js
   sandbox/gxm/geoext/gxm/lib/GXM/data/LayerStore.js
   sandbox/gxm/geoext/gxm/lib/GXM/data/models/Layer.js
   sandbox/gxm/geoext/gxm/lib/GXM/widgets/Button.js
   sandbox/gxm/geoext/gxm/lib/GXM/widgets/LayerList.js
   sandbox/gxm/geoext/gxm/lib/GXM/widgets/MapPanel.js
   sandbox/gxm/geoext/gxm/lib/GXM/widgets/SegmentedButton.js
Log:
[gxm] add comments

Modified: sandbox/gxm/geoext/gxm/lib/GXM/data/LayerReader.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/data/LayerReader.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/data/LayerReader.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -10,16 +10,30 @@
 
 Ext.ns("GXM.data");
 
+/** api: (define)
+ *  module = GXM.data
+ *  class = LayerReader
+ *  base_link = `Ext.data.JsonReader <http://dev.sencha.com/deploy/touch/docs/?class=Ext.data.JsonReader>`_
+ */
+
 GXM.data.LayerReader = Ext.extend(Ext.data.JsonReader, {
     root: '',
     readRecords: function(layers) {
         var recs = GXM.data.LayerReader.superclass.readRecords.call(this, layers);
         
-        //TODO: Discuss whether we can copy and adjust the contents of GXM.data.LayerReader.superclass.readRecords so we do not need to iterate twice over the records
+        //TODO: Discuss whether we can copy and adjust the contents of 
+        // GXM.data.LayerReader.superclass.readRecords so we do not need to 
+        // iterate twice over the records
+        //TODO: check whether a plain JsonReader is enough when extended with
+        // the GXM.data.LayerModelPlugin
         Ext.each(recs.records, function(record, index) {
+            //TODO: when we can access getLayer() inside of templates we don't 
+            //    need this
             if ( Ext.isDefined(record.data) && Ext.isDefined(record.data.layer)) {
                 record.data.layer = record.raw;
             }
+            //TODO: when we can access getLayer() inside of templates we don't 
+            //    need this
             if ( Ext.isDefined(record.data) && Ext.isDefined(record.data.zindex)) {
                 record.data.zindex = parseInt(record.raw.getZIndex(), 10);
             }
@@ -30,4 +44,5 @@
     
 });
 
+/** api: xtype = gxm_layerreader */
 Ext.reg('gxm_layerreader', GXM.data.LayerReader);

Modified: sandbox/gxm/geoext/gxm/lib/GXM/data/LayerStore.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/data/LayerStore.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/data/LayerStore.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -13,10 +13,57 @@
 /**
  * @requires GXM/data/models/Layer.js
  * @requires GXM/data/LayerReader.js
- * 
  */
 
+/** api: (define)
+ *  module = GXM.data
+ *  class = LayerStore
+ *  base_link = `Ext.data.Store <http://dev.sencha.com/deploy/touch/docs/?class=Ext.data.Store>`_
+ */
+
+/** api: constructor
+ *  .. class:: MapPanel(config)
+ *   
+ *      The class that is used to construct a GXM LayerStore.
+ */
 GXM.data.LayerStore = Ext.extend(Ext.data.Store, {
+    /** api: config[model]
+     * 
+     *  ``String`` The identifier for the model to be used. 
+     *  Defaults to ``gxm_layer``.
+     */
+    
+    /** api: config[proxy]
+     * 
+     *  ``String/Ext.data.Proxy/Object`` The proxy to be used by the store.
+     *  Defaults to a configuration object for a `Ext.data.MemoryProxy <http://dev.sencha.com/deploy/touch/docs/?class=Ext.data.MemoryProxy>`_
+     *  that has a :class:`GXM.data.LayerReader` set as `reader`-property.
+     */
+    
+    /** api: config[sorters]
+     * 
+     *  ``Array(Ext.util.Sorter)`` An array of `Sorters <http://dev.sencha.com/deploy/touch/docs/?class=Ext.util.Sorter>`_ 
+     *  to be used for ordering of the records. Defaults to a single  sorter 
+     *  that orders the layers descending according to the stack size inside of 
+     *  the map. That means that layers drawn atop of others in the map will be
+     *  on top inside of lists that make use of this store. 
+     *  
+     *  The configuration of the single sorter can also be configured using the 
+     *  :attr:`sortField` and :attr:`sortDirection` configuration properties.
+     */
+    
+    /** api: config[sortField]
+     * 
+     *  ``String`` The field to order the store by if no :attr:`sorters`.
+     *  Defaults to `zindex`.
+     */
+    
+    /** api: config[sortDirection]
+     * 
+     *  ``String`` The direction to order the store by if no :attr:`sorters`.
+     *  Defaults to `DESC`.
+     */
+    
     constructor: function(config) {
         var conf = config || {};
         
@@ -24,8 +71,7 @@
         
         conf.proxy = conf.proxy || {
             type: 'memory',
-            reader: new GXM.data.LayerReader({})
-            //reader: 'json'
+            reader: new GXM.data.LayerReader()
         };
                
         conf.sorters = conf.sorters || [{
@@ -37,5 +83,6 @@
     }
 });
 
+/** api: xtype = gxm_layerstore */
 Ext.reg('gxm_layerstore', GXM.data.LayerStore);
 

Modified: sandbox/gxm/geoext/gxm/lib/GXM/data/models/Layer.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/data/models/Layer.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/data/models/Layer.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -9,6 +9,10 @@
  */
 Ext.ns('GXM.data');
 
+/** api: (define)
+ *  module = GXM.data
+ *  class = LayerModelPlugin
+ */
 GXM.data.LayerModelPlugin = Ext.extend(Object, {
     bootstrap: function(model, config){
         Ext.override(model, {
@@ -16,14 +20,12 @@
                 return this.raw;   
             }
         });
-        
     }
 });
 
-
+/** api: ptype = gxm_layermodel */
 Ext.preg("gxm_layermodel", GXM.data.LayerModelPlugin);
 
-
 Ext.regModel('gxm_layer', {
     plugins:[{ptype:'gxm_layermodel'}],
     fields: [
@@ -40,4 +42,7 @@
             name: 'layer'
         }
     ]
-});
\ No newline at end of file
+});
+
+// the template should catch this.
+/** api: model = gxm_layerreader */ 
\ No newline at end of file

Modified: sandbox/gxm/geoext/gxm/lib/GXM/widgets/Button.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/widgets/Button.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/widgets/Button.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -8,16 +8,123 @@
  * text of the license.
  */
 
-
 Ext.ns('GXM');
 
+/** api: (define)
+ *  module = GXM
+ *  class = Button
+ *  base_link = `Ext.Button <http://dev.sencha.com/deploy/touch/docs/?class=Ext.Button>`_
+ */
+
+/** api: example
+ *  Sample code to create a GXM.Button that controls zooms in:
+ * 
+ *  .. code-block:: javascript
+ *  
+ *    // create the GXM.Button:
+ *    var btnZoomIn = new GXM.Button({
+ *        control: new OpenLayers.Control.ZoomIn(),
+ *        map: map,
+ *        iconCls: 'add',
+ *        iconMask: true,
+ *        handler: function(){
+ *            // implement Ext.Button handlers as usual
+ *        }
+ *    });
+ *    
+ *    // The GXM.Button can be used e.g. in a toolbar that is docked to a panel:
+ *    new Ext.Panel({
+ *        dockedItems: [{
+ *            xtype: 'toolbar',
+ *            dock: 'top',
+ *            items: [
+ *                btnZoomIn
+ *            ]
+ *        }
+ *    });
+ *     
+ */
+
+/** api: constructor
+ *  .. class:: Button(config)
+ *   
+ *      The class that is used to build a GXM button.
+ */
 GXM.Button = Ext.extend(Ext.Button, {
+    /** api: config[exclusiveGroup]
+     * 
+     *  ``String``  An identifier for the exclusive group of GXM-Buttons that
+     *  this button belongs to. This can be used to press/unpress buttons that
+     *  would otherwise compete with each other. 
+     *  
+     *  An example would be the buttons to control the digitizing of geometries
+     *  on the map where you would have a GXM.Button for points, linestrings and
+     *  polygons. When these buttons share the same `exclusiveGroup` the pressed
+     *  state will be managed automatically.
+     */
+
+    /** api: property[exclusiveGroup]
+     * 
+     *  ``String`` An identifier for the exclusive group of GXM-Buttons that
+     *  this button belongs to.
+     */
     exclusiveGroup:null,
+    
+    /** api: config[map]
+     * 
+     *  ``OpenLayers.Map`` The map that this control belongs to. If the control 
+     *  isn't already added to the map's list of controls, it'll be added by the
+     *  class.
+     */
+
+    /** api: property[map]
+     * 
+     *  ``OpenLayers.Map`` An OpenLayers-Map-instance.
+     */
     map: null,
-    mappanel: null,
+    
+    /** api: config[mapPanel] 
+     * 
+     *  ``GXM.MapPanel`` The MapPanel this button belongs to. Might be used to 
+     *  derive the :attr:`map`.
+     */
+
+    /** api: property[mapPanel]
+     * 
+     *  ``GXM.MapPanel`` The MapPanel of this button.
+     */
+    mapPanel: null,
+    
+    /** private: property[uScope]
+     * 
+     *  ``Object`` The scope the user-defined button handler method shall be 
+     *  executed in.
+     */
     uScope: null,
+    
+    /** private: property[uHandler]
+     *  
+     *  ``Function`` The user-defined handler-method to invoke as handler for 
+     *  the button.
+     */
     uHandler: null,
+    
+    /** api: config[control] 
+     * 
+     *  ``OpenLayers.Control`` The control instance that this button shall work
+     *  on.
+     */
+
+    /** api: property[control]
+     * 
+     *  ``OpenLayers.Control`` The control instance that this button works on.
+     */
     control:null,
+    
+    /** private: method[initComponent]
+     * 
+     *  Initializes the button.
+     */
     initComponent : function(){
         GXM.Button.superclass.initComponent.call(this);
         
@@ -52,7 +159,19 @@
         }
         
     },
-
+    
+    /** private: property[pScope]
+     * 
+     *  ``GXM.Button`` The scope the auto-defined button handler method shall be 
+     *  executed in. Will be `this`, e.g. the current GXM.Button-instance.
+     */
+    
+    /** private: method[pHandler]
+     *  
+     *  The auto-defined handler-method to invoke as handler for 
+     *  the button. Handles the activation/deactivation or triggering of the 
+     *  configured OpenLayers.Control.
+     */
     pHandler: function(cmp) {
         var ctrl = this.control;
         if(ctrl &&
@@ -72,7 +191,14 @@
             this.uHandler.apply(this.uScope, args);
         }
     },
-          
+    
+    /** api: method[getExclusiveGroupMembers]
+     *  :return:  ``Array(GXM.Button)`` An array of all members of the 
+     *      :attr:`exclusiveGroup` that this Button belongs to.
+     *  
+     *  Returns an array of all members of the :attr:`exclusiveGroup` that this
+     *  Button belongs to.
+     */      
     getExclusiveGroupMembers: function() {
         var members = [];
         var myGroup = this.exclusiveGroup;
@@ -86,6 +212,12 @@
         return members;
     },
     
+    /** private: method[onCtrlActivate]
+     * 
+     *  Called when the configured control is activated. Handles the 
+     *  deactivation of the other OpenLayers.Controls and the updating of the 
+     *  visual states (removal of `pressedCls`).
+     */
     onCtrlActivate: function(){
         var exclusiveGroupMembers = this.getExclusiveGroupMembers();
         var myId = this.id;
@@ -108,6 +240,11 @@
             this.addCls(this.pressedCls);
         }
     },
+    
+    /** private: method[onCtrlDeactivate]
+     * 
+     *  Called on control deactivation. Removes this button's `pressedCls`
+     */
     onCtrlDeactivate: function(){
         if(!this._isDeactivating) {
             this.removeCls(this.pressedCls);
@@ -115,9 +252,10 @@
     }
 });
 
+/** api: xtype = gxm_button */
 Ext.reg('gxm_button', GXM.Button);
 
 // usually a Ext.ComponentQuery.query('gxm_button[exclusiveGroup="humpty"]') 
-// would be enough, but it seems as if we currently hav a bug in sencha:
+// would be enough, but it seems as if we currently have a bug in sencha:
 // http://www.sencha.com/forum/showthread.php?120633-Ext.ComponentQuery.query()-not-working
 GXM.Button.manager = new Ext.AbstractManager();
\ No newline at end of file

Modified: sandbox/gxm/geoext/gxm/lib/GXM/widgets/LayerList.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/widgets/LayerList.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/widgets/LayerList.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -8,29 +8,88 @@
  * text of the license.
  */
 
-// requires model/Layer.js
+/**
+ * @requires GXM/data/models/Layer.js
+ */
+// Ext.ns is technically not needed, since the above require-directive
+Ext.ns('GXM');
 
+/** api: (define)
+ *  module = GXM
+ *  class = LayerList
+ *  base_link = `Ext.List <http://dev.sencha.com/deploy/touch/docs/?class=Ext.List>`_
+ */
+
+/** api: example
+ *  Sample code to create a GXM.Button that controls zooms in:
+ * 
+ *  .. code-block:: javascript
+ *  
+ *    // create a lazily instanciated GXM.LayerList:
+ *    var layerList = {
+ *        xtype: 'gxm_layerlist',
+ *        // call with mapPanel...
+ *        mapPanel: mapPanel,
+ *        // ... or with layers and map, e.g.
+ *        // layers: mapPanel.layers,
+ *        // map: map,
+ *        listeners: {
+ *            itemtap: function(){
+ *                Ext.Msg.alert(
+ *                    'Application event "itemtap"', 
+ *                    'You can still register events as usual.'
+ *                );
+ *            }
+ *        }
+ *    };
+ *    
+ */
+
+/** api: constructor
+ *  .. class:: LayerList(config)
+ *   
+ *      The class that is used to build a GXM list of layers.
+ */
 GXM.LayerList = Ext.extend(Ext.List, {
     
+    /** api: config[layers]
+     * 
+     *  :class:``GXM.data.LayerStore`` The layerstore this list is about to use.
+     */
+    
+    /** api: property[layers]
+     *
+     *  :class:``GXM.data.LayerStore`` The layerstore this list uses.
+     */
     layers: null,
     
+    /** api: config[mapPanel] 
+     * 
+     *  ``GXM.MapPanel`` The MapPanel this list belongs to. Might be used to 
+     *  derive the :attr:`map` and the :attr:`layers`
+     */
+
+    /** api: property[mapPanel]
+     * 
+     *  ``GXM.MapPanel`` The MapPanel of this list.
+     */
     mapPanel: null,
     
+    /** api: config[map]
+     * 
+     *  ``OpenLayers.Map`` The map that the Layer-records belong to.
+     */
+
+    /** api: property[map]
+     * 
+     *  ``OpenLayers.Map`` The map that the Layer-records belong to.
+     */
     map: null,
     
-    onItemTap: function(item, index, e){
-        var record = this.getStore().getAt(index);
-        var layer = record.getLayer();
-        if (layer.isBaseLayer) {
-            this.map.setBaseLayer(layer);
-        }
-        else {
-            layer.setVisibility(!layer.getVisibility());
-        }
-        this.refresh();
-        GXM.LayerList.superclass.onItemTap.call(this, arguments);
-    },
-    
+    /** private: method[initComponent]
+     * 
+     *  Initializes the layerlist.
+     */
     initComponent: function(){
         
         if (this.mapPanel && this.mapPanel instanceof GXM.MapPanel) {
@@ -41,6 +100,7 @@
         }
         
         //TODO: or only one if that returns correct CSS-class?
+        //TODO: figure out how to use rec.getLayer() inside of templates, that'd make rec.layer obsolete
         this.itemTpl = new Ext.XTemplate(
             '<tpl if="this.isVisible(layer)">', 
                 '<span class="gxm-visible-layer-indicator"></span>' ,
@@ -75,10 +135,40 @@
         GXM.LayerList.superclass.initComponent.call(this);
     },
     
+    /** private: method[onItemTap]
+     *  :param item: ``Ext.Element`` The listitem that was tapped
+     *  :param index: ``Number`` The index inside the list
+     *  :param e: ``Ext.EventObject`` The event-object 
+     *  
+     *  Called on item tap. toggles visibility of the associated layers or sets
+     *  the maps baselayer.
+     */
+    onItemTap: function(item, index, e){
+        var record = this.getStore().getAt(index);
+        var layer = record.getLayer();
+        if (layer.isBaseLayer) {
+            this.map.setBaseLayer(layer);
+        }
+        else {
+            layer.setVisibility(!layer.getVisibility());
+        }
+        this.refresh();
+        GXM.LayerList.superclass.onItemTap.call(this, arguments);
+    },
+    
+    /** private: method[onChangeLayer]
+     *  :param e: ``Ext.EventObject`` The event-object 
+     *  
+     *  Reloads the store and refreshes the lists UI so it reflects the current 
+     *  state of layers managed by the list.
+     */
     onChangeLayer: function(evt){
+        //TODO: check whether this.store.load is enough (no argument passed).
         this.store.load(this.mapPanel.layers);
         this.refresh();
     }
     
 });
+
+/** api: xtype = gxm_layerlist */
 Ext.reg('gxm_layerlist', GXM.LayerList);

Modified: sandbox/gxm/geoext/gxm/lib/GXM/widgets/MapPanel.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/widgets/MapPanel.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/widgets/MapPanel.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -11,7 +11,7 @@
 /**
  * @requires GXM/data/LayerStore.js
  */
-
+// Ext.ns is technically not needed, since the above require-directive
 Ext.ns('GXM');
 
 /** api: (define)
@@ -21,7 +21,7 @@
  */
 
 /** api: example
- *  Sample code to create a MapPanel that fills the whole screen:
+ *  Sample code to create a GXM.MapPanel that fills the whole screen:
  * 
  *  .. code-block:: javascript
  *  
@@ -38,7 +38,7 @@
  *            });
  *        } // end of the onReady-funcion
  *    });
- *     
+ *    
  */
 
 /** api: constructor
@@ -103,7 +103,7 @@
      *  items should be minx, miny, maxx, maxy.
      */
     bounds: null,
-    // TODO we should be align this to GeoExt's extent, shouldn't we?
+    //TODO: we should align this to GeoExt's extent, shouldn't we?
     
     /** api: config[fullscreen]
      * 
@@ -137,7 +137,7 @@
     
     /** private: method[initComponent]
      * 
-     *  ``Function`` Initializes the Component.
+     *  Initializes the Component.
      */
     initComponent: function(){
         // set scroll to false just as the original Map-component of 
@@ -205,45 +205,57 @@
         } else if(Ext.isArray(this.extent)) {
             this.extent = OpenLayers.Bounds.fromArray(this.extent);
         }
+        
+        // call the superclass constructor
         GXM.MapPanel.superclass.initComponent.call(this);
         
-        // events
+        // events        
+        //TODO: discuss whether we need our own mapping to the OpenLayers-Events
         this.addEvents(
             /** private: event[aftermapmove]
+             * 
              *  Fires after the map is moved.
              */
             "aftermapmove",
 
             /** private: event[afterlayervisibilitychange]
+             * 
              *  Fires after a layer changed visibility.
              */
             "afterlayervisibilitychange",
 
             /** private: event[afterlayeropacitychange]
+             * 
              *  Fires after a layer changed opacity.
              */
             "afterlayeropacitychange",
 
             /** private: event[afterlayerorderchange]
+             * 
              *  Fires after a layer order changed.
              */
             "afterlayerorderchange",
 
             /** private: event[afterlayernamechange]
+             * 
              *  Fires after a layer name changed.
              */
             "afterlayernamechange",
 
             /** private: event[afterlayeradd]
+             * 
              *  Fires after a layer added to the map.
              */
             "afterlayeradd",
 
             /** private: event[afterlayerremove]
+             * 
              *  Fires after a layer removed from the map.
              */
             "afterlayerremove"
         );
+        
+        // bind various listeners to the corresponding OpenLayers.Map-events
         this.map.events.on({
             "moveend": this.onMoveend,
             "changelayer": this.onChangelayer,
@@ -251,13 +263,11 @@
             "removelayer": this.onRemovelayer,
             scope: this
         });
-        
-        
     },
     
     /** private: method[onMoveend]
      *
-     *  The "moveend" listener.
+     *  The "moveend" listener bound to the :attr:`map`.
      */
     onMoveend: function() {
         this.fireEvent("aftermapmove");
@@ -266,7 +276,7 @@
     /** private: method[onChangelayer]
      *  :param e: ``Object``
      *
-     * The "changelayer" listener.
+     *  The "changelayer" listener bound to the :attr:`map`.
      */
     onChangelayer: function(e) {
         if(e.property) {
@@ -283,6 +293,8 @@
     },
 
     /** private: method[onAddlayer]
+     * 
+     *  The "addlayer" listener bound to the :attr:`map`.
      */
     onAddlayer: function() {
         this.layers.load();
@@ -290,6 +302,8 @@
     },
 
     /** private: method[onRemovelayer]
+     * 
+     *  The "removelayer" listener bound to the :attr:`map`.
      */
     onRemovelayer: function() {
         this.layers.load();
@@ -297,15 +311,24 @@
     },
     
     /** private: method[onRender]
+     * 
+     *  The internal method called when rendering the component. Calls the 
+     *  parent's method and ensures that the visibility mode is set to a usefull
+     *  value.
      */   
     onRender : function(container, position) {
-        // set setVisibilityMode to Ext.Element.OFFSETS just as the 
-        // original Map-component of Sencha Touch does (Review BvdE).
+        // Call the parents method...
         GXM.MapPanel.superclass.onRender.apply(this, arguments);
+        // ...and then set the visibility mode to Ext.Element.OFFSETS just as 
+        // the original Map-component of Sencha Touch does (Review BvdE).
         this.el.setVisibilityMode(Ext.Element.OFFSETS);        
     },
     
     /** private: method[afterRender]
+     * 
+     *  The internal method called when rendering the component is done. Calls 
+     *  the parent's method and ensures that the map-rendering process (via 
+     *  this.renderMap) starts or is delayed to an appropriate eventlistener.
      */ 
     afterRender: function(){
         GXM.MapPanel.superclass.afterRender.apply(this, arguments);
@@ -325,17 +348,27 @@
         }
     },
     
-    /** private: method[afterRender]
+    /** private: method[renderMap]
+     * 
+     *  The internal method that explicitly renders the map into the dom-element
+     *  of this component. Calls OpenLayers.Map::render to get the map div 
+     *  populated.
      */ 
     renderMap: function(){
         var me = this;
         var map = me.map;
         
+        // This is taken from the Sencha-Touch Map-component and ensures that 
+        // there is no child element inside the target div we wish to render the
+        // Map in.
+        //TODO: evaluate whether this is enough or whether we need an iteration 
+        //      on child elements
         if (me.el && me.el.dom && me.el.dom.firstChild) {
             Ext.fly(me.el.dom.firstChild).remove();
         }
         map.render(me.el.dom);
         
+        // Adjust the geographic position according to the passed config-options 
         if (!map.getCenter()) {
             if (this.center || this.zoom ) {
                 // center and/or zoom?
@@ -351,6 +384,9 @@
     },
     
     /** private: method[updateMapSize]
+     * 
+     *  Internal method that updates the Map size when the parent container 
+     *  moves (see afterRender-method).
      */
     //TODO: check if we need this
     updateMapSize: function() {
@@ -396,8 +432,8 @@
  *      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.
+ *  can reliably be used for all applications that just have one map panel
+ *  in the viewport.
  */
 GXM.MapPanel.guess = function() {
     var guess;
@@ -410,4 +446,5 @@
     return guess;
 };
 
+/** api: xtype = gxm_mappanel */
 Ext.reg('gxm_mappanel', GXM.MapPanel);

Modified: sandbox/gxm/geoext/gxm/lib/GXM/widgets/SegmentedButton.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/GXM/widgets/SegmentedButton.js	2011-07-24 21:33:04 UTC (rev 2780)
+++ sandbox/gxm/geoext/gxm/lib/GXM/widgets/SegmentedButton.js	2011-07-24 22:56:18 UTC (rev 2781)
@@ -8,7 +8,10 @@
  * text of the license.
  */
 
-
+//TODO: double check whether we need this class as the need functionality might 
+//    be replaceable with xtype 'segmentedbutton' and a default xtype of
+//    'gxm_button' for the child items. See review.
+ 
 Ext.ns('GXM');
 GXM.SegmentedButton = Ext.extend(Ext.SegmentedButton, {
     initComponent: function(){



More information about the Commits mailing list