[Commits] r545 - core/trunk/geoext/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Thu Apr 30 07:19:50 CEST 2009
Author: tschaub
Date: 2009-04-30 07:19:50 +0200 (Thu, 30 Apr 2009)
New Revision: 545
Modified:
core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js
Log:
Docs for MapPanel (see #53).
Modified: core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js 2009-04-30 05:07:24 UTC (rev 544)
+++ core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js 2009-04-30 05:19:50 UTC (rev 545)
@@ -9,96 +9,92 @@
* @include GeoExt/data/LayerStore.js
*/
+/** jst: (define)
+ * module = GeoExt
+ * class = MapPanel
+ * base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
+ */
Ext.namespace("GeoExt");
-/**
- * Class: GeoExt.MapPanel
- * A map panel is a panel with a map inside it.
- *
- * Example: create a map panel and render it in a div identified
- * by "div-id".
- *
- * (start code)
- * var mapPanel = new GeoExt.MapPanel({
- * border: false,
- * renderTo: "div-id",
- * map: new OpenLayers.Map({
- * maxExtent: new OpenLayers.Bounds(-90, -45, 90, 45)
- * })
- * });
- * (end)
- *
- * Example: create a panel including a map panel with a toolbar.
- *
- * (start code)
- * var panel = new Ext.Panel({
- * items: [{
- * xtype: "gx_mappanel",
- * bbar: new Ext.Toolbar()
- * }]
- * });
- * (end)
- *
- * Inherits from:
- * - {Ext.Panel}
+/** jst: example
+ * Sample code to create a panel with a new map:
+ *
+ * .. code-block:: javascript
+ *
+ * var mapPanel = new GeoExt.MapPanel({
+ * border: false,
+ * renderTo: "div-id",
+ * map: {
+ * maxExtent: new OpenLayers.Bounds(-90, -45, 90, 45)
+ * }
+ * });
+ *
+ * Sample code to create a map panel with a bottom toolbar in a Window:
+ *
+ * .. code-block:: javascript
+ *
+ * var win = new Ext.Window({
+ * title: "My Map",
+ * items: [{
+ * xtype: "gx_mappanel",
+ * bbar: new Ext.Toolbar()
+ * }]
+ * });
*/
-/**
- * Constructor: GeoExt.MapPanel
- * Creates a panel with a map inside it.
- *
- * Parameters:
- * config - {Object} A config object. In addition to the config options
- * of its parent class, this object can receive specific options,
- * see the API properties to know about these specific options.
+/** jst: constructor
+ * .. class:: MapPanel(config)
+ *
+ * Create a panel container for a map.
*/
GeoExt.MapPanel = Ext.extend(Ext.Panel, {
- /**
- * APIProperty: map
- * {OpenLayers.Map|Object} An {OpenLayers.Map} instance
- * or an {OpenLayers.Map} config object, in the latter case
- * the map panel will take care of creating the {OpenLayers.Map}
- * object.
+
+ /** jst: config[map]
+ * ``OpenLayers.Map or Object`` A configured map or a configuration object
+ * for the map constructor. A configured map will be available after
+ * construction through the :attr:`map` property.
*/
+
+ /** jst: property[map]
+ * ``OpenLayers.Map`` A configured map object.
+ */
map: null,
- /**
- * APIProperty: layers
- * {GeoExt.data.LayerStore|GeoExt.data.GroupingStore|Array(OpenLayers.Layer)}
- * A store holding records. If not provided, an empty
- * {<GeoExt.data.LayerStore>} will be created. After instantiation
- * this property will always be an {Ext.data.Store}, even if an array
- * of {OpenLayers.Layer} was provided.
+ /** jst: config[layers]
+ * ``GeoExt.data.LayerStore or GeoExt.data.GroupingStore or Array(OpenLayers.Layer)``
+ * A store holding records. If not provided, an empty
+ * :class:`GeoExt.data.LayerStore` will be created.
*/
+
+ /** jst: property[layers]
+ * :class:`GeoExt.data.LayerStore` A store containing
+ * :class:`GeoExt.data.LayerRecord` objects.
+ */
layers: null,
- /**
- * APIProperty: center
- * {OpenLayers.LonLat} The lonlat to which the map will
- * be initially centered, to be used in conjunction with
- * the zoom option.
+
+ /** jst: config[center]
+ * ``OpenLayers.LonLat or Array(Number)`` A location for the map center. If
+ * an array is provided, the first two items should represent x & y coordinates.
*/
center: null,
- /**
- * APIProperty: zoom
- * {Number} The initial zoom level of the map, to be used
- * in conjunction with the center option.
+ /** jst: config[zoom]
+ * ``Number`` An initial zoom level for the map.
*/
zoom: null,
- /**
- * APIProperty: extent
- * {OpenLayers.Bounds} The initial extent of the map, use
- * either this option of the center and zoom options.
+ /** jst: config[extent]
+ * ``OpenLayers.Bounds or Array(Number)`` An initial extent for the map (used
+ * if center and zoom are not provided. If an array, the first four items
+ * should be minx, miny, maxx, maxy.
*/
extent: null,
- /**
- * Method: initComponent
- * Initializes the map panel. Creates an OpenLayers map if
- * none was provided in the config options passed to the
- * constructor.
+ /** private: method[initComponent]
+ * Initializes the map panel. Creates an OpenLayers map if
+ * none was provided in the config options passed to the
+ * constructor.
*/
initComponent: function(){
if(!(this.map instanceof OpenLayers.Map)) {
@@ -128,9 +124,8 @@
GeoExt.MapPanel.superclass.initComponent.call(this);
},
- /**
- * Method: updateMapSize
- * Tell the map that it needs to recaculate its size and position.
+ /** private: method[updateMapSize]
+ * Tell the map that it needs to recaculate its size and position.
*/
updateMapSize: function() {
if(this.map) {
@@ -138,10 +133,9 @@
}
},
- /**
- * Method: onRender
- * Private method called after the panel has been
- * rendered.
+ /** private: method[onRender]
+ * Private method called after the panel has been
+ * rendered.
*/
onRender: function() {
GeoExt.MapPanel.superclass.onRender.apply(this, arguments);
@@ -158,9 +152,8 @@
}
},
- /**
- * Method: afterRender
- * Private method called after the panel has been rendered.
+ /** private: method[afterRender]
+ * Private method called after the panel has been rendered.
*/
afterRender: function() {
GeoExt.MapPanel.superclass.afterRender.apply(this, arguments);
@@ -169,19 +162,16 @@
}
},
- /**
- * Method: onResize
- * Private method called after the panel has been
- * resized.
+ /** private: method[onResize]
+ * Private method called after the panel has been resized.
*/
onResize: function() {
GeoExt.MapPanel.superclass.onResize.apply(this, arguments);
this.updateMapSize();
},
- /**
- * Method: onDestroy
- * Private method called during the destroy sequence.
+ /** private: method[onDestroy]
+ * Private method called during the destroy sequence.
*/
onDestroy: function() {
if(this.ownerCt) {
@@ -192,7 +182,5 @@
});
-/**
- * XType: gx_mappanel
- */
+/** jst: xtype = gx_mappanel */
Ext.reg('gx_mappanel', GeoExt.MapPanel);
More information about the Commits
mailing list