[Commits] r2255 - in sandbox/foss4g2010/src/doc: basics layout wfs

commits at geoext.org commits at geoext.org
Mon Aug 2 17:00:51 CEST 2010


Author: yjacolin
Date: 2010-08-02 17:00:51 +0200 (Mon, 02 Aug 2010)
New Revision: 2255

Modified:
   sandbox/foss4g2010/src/doc/basics/dissect.rst
   sandbox/foss4g2010/src/doc/basics/map1.png
   sandbox/foss4g2010/src/doc/layout/layout.rst
   sandbox/foss4g2010/src/doc/layout/legend.rst
   sandbox/foss4g2010/src/doc/layout/tree.rst
   sandbox/foss4g2010/src/doc/wfs/grid.png
   sandbox/foss4g2010/src/doc/wfs/grid.rst
   sandbox/foss4g2010/src/doc/wfs/layer.png
   sandbox/foss4g2010/src/doc/wfs/layer.rst
Log:
update tutorials with new data, add some comments on code

Modified: sandbox/foss4g2010/src/doc/basics/dissect.rst
===================================================================
--- sandbox/foss4g2010/src/doc/basics/dissect.rst	2010-08-02 14:34:12 UTC (rev 2254)
+++ sandbox/foss4g2010/src/doc/basics/dissect.rst	2010-08-02 15:00:51 UTC (rev 2255)
@@ -113,13 +113,10 @@
         layout: "fit",
         items: [{
             xtype: "gx_mappanel",
-            layers: [new OpenLayers.Layer.WMS("Global Imagery",
-                "http://maps.opengeo.org/geowebcache/service/wms", {
-                    layers: "bluemarble"
-                }, {
-                    buffer: 0,
-                    visibility: false
-                }
+            layers: [new OpenLayers.Layer.WMS(
+                        "Tasmania",
+                        "/geoserver/wms?",
+                        {layers: "tasmania"}
             )],
             extent: new OpenLayers.Bounds(
                 143.83482400000003, -43.648056,

Modified: sandbox/foss4g2010/src/doc/basics/map1.png
===================================================================
(Binary files differ)

Modified: sandbox/foss4g2010/src/doc/layout/layout.rst
===================================================================
--- sandbox/foss4g2010/src/doc/layout/layout.rst	2010-08-02 14:34:12 UTC (rev 2254)
+++ sandbox/foss4g2010/src/doc/layout/layout.rst	2010-08-02 15:00:51 UTC (rev 2255)
@@ -3,6 +3,12 @@
 Organize the Application Interface Using a ViewPort
 ===================================================
 
+A viewport is a container inside the viewable application area, i.e. the browser viewport and sizes itself to the size available.
+
+A viewport is split in several part called center, east, west, north and south.
+
+Now we built our 3 panels (legend, tree and map) we need to join all together to get a nice interface! This is what layout are used for.
+
 .. code-block:: javascript
 
         Ext.onReady(function() {
@@ -90,6 +96,10 @@
             });
         });
 
+The MapPanel is now an instance like LegendPanel and TreePanel, we added a `region` property to setup the location in the viewport.
+
+You can add panel in the viewport instead instance. Add this tab panel in the viewport:
+
 .. code-block:: javascript
 
     {
@@ -98,18 +108,23 @@
         width: 250
     }
 
+In this tab panel we add tabs. The first one will be used for the tree Panel. Add the config object below in the `items` property of the tab panel:
 
 .. code-block:: javascript
 
     activeTab: 0,
     items: [tree]
 
-.. note::
+.. warning::
 
-    Don't forget to add a title to the tree panel.
-    Also no need to render the panel, the rendering will be done by Ext while doing the layout.
+    Don't forget to add a title to the tree panel otherwise you will get ugly empty tab. Also no need to render the panel, the rendering will be done by Ext while doing the layout.
 
 Repeat the same operation for legendPanel. You should now have a column on the left with two tabs.
 
 .. code-block:: javascript
 
+    {
+	activeTab: 1,
+	title: "Legend",
+	items: [legendPanel]
+    }

Modified: sandbox/foss4g2010/src/doc/layout/legend.rst
===================================================================
--- sandbox/foss4g2010/src/doc/layout/legend.rst	2010-08-02 14:34:12 UTC (rev 2254)
+++ sandbox/foss4g2010/src/doc/layout/legend.rst	2010-08-02 15:00:51 UTC (rev 2255)
@@ -3,6 +3,8 @@
 Create a LegendPanel
 ====================
 
+Add a legend to the map is as easy as adding this code:
+
 .. code-block:: javascript
 
     var legendPanel = new GeoExt.LegendPanel({
@@ -13,3 +15,7 @@
         bodyStyle: 'padding:5px'
     });
     legendPanel.render(document.body);
+
+The LegendPanel instance will change any time you load or unload layers.
+
+As for the treePanel instance the last line render the legend panel inside the body tag ofthe page. You can use the `render` property as well. The three properties in the LegendPanel instance allow you to setup style via CSS in three different ways.
\ No newline at end of file

Modified: sandbox/foss4g2010/src/doc/layout/tree.rst
===================================================================
--- sandbox/foss4g2010/src/doc/layout/tree.rst	2010-08-02 14:34:12 UTC (rev 2254)
+++ sandbox/foss4g2010/src/doc/layout/tree.rst	2010-08-02 15:00:51 UTC (rev 2255)
@@ -4,7 +4,7 @@
 ===================================
 
 We want several layers: base and overlay layers.
-Modify the ``layers`` array to match the following.
+Add a ``layers`` array to match the following.
 
 .. code-block:: javascript
 
@@ -76,14 +76,17 @@
         )
     ];
 
+You need to find where layers array is used in the MapPanel code to use the new one.
+
 Also, since we don't want all layers to be considered as overlays we need to set
-options for our map.
-Add the following to your `GeoExt.MapPanel` configuration object:
+options for our map. Add the following to your `GeoExt.MapPanel` configuration object:
 
 .. code-block:: javascript
 
     map: new OpenLayers.Map({allOverlays: false})
 
+The code below create the `treePanel` following a `treeConfig` object.
+
 .. code-block:: javascript
 
     var treeConfig = [{
@@ -115,7 +118,23 @@
     });
     tree.render(document.body);
 
-Don't forget to add a title to the tree panel
+Don't forget to add a title to the tree panel.
 
+.. note::
+  the `treeConfig` instance don't refer to the mapPanel instance. A method is used to find a MapPanel instance (the first MapPanel instance find actually).
 
+The treeConfig array allow to configure the layer tree. You have two layer container: baselayercontainer and overlaylayercontainer. The first one will contains base layer and the latter one overlays. The expand parameter allow you to expand tree when loaded. 
 
+You can also create your own tree with the `gx_layer` value in the nodeType property. The `layer` property link to the layers called "Tasmania (Group Layer)" in the layers array and the `loader` method tell which parameter used in the URL to get the layer name, LAYER parameter in this case which is the parameter which list the layer name to retreive in a WMS request.
+
+The TreePanel is a normal ExtJS panel. Several options are available, here arethe one we used: 
+
+- `border`: to add a border line around the panel, (defaults to true).
+- `loader`: A Ext.tree.TreeLoader for use with this TreePanel.
+- `root`: The root node for the tree.
+- `rootVisible`: false to hide the root node (defaults to true)
+
+The last line render the `tree` instance inside the body tag of the page. You can use the `render` property inside the tree instance to do the same thing.
+
+
+

Modified: sandbox/foss4g2010/src/doc/wfs/grid.png
===================================================================
(Binary files differ)

Modified: sandbox/foss4g2010/src/doc/wfs/grid.rst
===================================================================
--- sandbox/foss4g2010/src/doc/wfs/grid.rst	2010-08-02 14:34:12 UTC (rev 2254)
+++ sandbox/foss4g2010/src/doc/wfs/grid.rst	2010-08-02 15:00:51 UTC (rev 2255)
@@ -40,7 +40,8 @@
                     fields: [
                         {name: "LANAME", type: "string"},
                         {name: "CFCC", type: "string"},
-                        {name: "LAND", type: "float"}
+                        {name: "LAND", type: "float"},
+			{name: "AREA", type: "int", defaultValue: 10000}
                     ],
                     proxy: new GeoExt.data.ProtocolProxy({
                         protocol: new OpenLayers.Protocol.WFS({
@@ -65,8 +66,9 @@
                         },
                         columns: [
                             {header: "Name", dataIndex: "LANAME"},
-                            {header: "CFCC", dataIndex: "CFCC"},
-                            {header: "Land", dataIndex: "LAND"}
+			    {header: "CFCC", dataIndex: "CFCC"},
+			    {header: "Land", dataIndex: "LAND", width: 10},
+			    {xtype: "numbercolumn",header: "Area", dataIndex: "AREA", format: "1,000", align: "right"}
                         ]
                     })
                 });
@@ -108,19 +110,19 @@
 
     var store = new GeoExt.data.FeatureStore({
         fields: [
-            {name: "name", type: "string"},
-            {name: "owner", type: "string"},
-            {name: "usage", type: "string"},
-            {name: "number_fac", type: "int", defaultValue: 0}
+	    {name: "LANAME", type: "string"},
+            {name: "CFCC", type: "string"},
+            {name: "LAND", type: "float"},
+	    {name: "AREA", type: "int", defaultValue: 10000}
         ],
-        proxy: new GeoExt.data.ProtocolProxy({
-            protocol: new OpenLayers.Protocol.WFS({
-                url: "/geoserver/ows",
-                version: "1.1.0",
-                featureType: "parks",
-                featureNS: "http://medford.opengeo.org",
-                srsName: "EPSG:4326"
-            })
+	proxy: new GeoExt.data.ProtocolProxy({
+	    protocol: new OpenLayers.Protocol.WFS({
+		url: "/geoserver/wms",
+		version: "1.1.0",
+		featureType: "poly_landmarks",
+		featureNS: "http://www.census.gov",
+		srsName: "EPSG:4326"
+	    })
         }),
         autoLoad: true
     });
@@ -160,17 +162,10 @@
                 sortable: true
             },
             columns: [
-                {header: "Name", dataIndex: "name"},
-                {header: "Owner", dataIndex: "owner"},
-                {header: "Usage", dataIndex: "usage", width: 35},
-                {
-                    xtype: "numbercolumn",
-                    header: "# of Facilities",
-                    dataIndex: "number_fac",
-                    format: "1,000",
-                    align: "right",
-                    width: 55
-                }
+		{header: "Name", dataIndex: "LANAME"},
+                {header: "CFCC", dataIndex: "CFCC"},
+                {header: "Land", dataIndex: "LAND", width: 10},
+		{xtype: "numbercolumn", header: "Area", dataIndex: "AREA", format: "1,000", align: "right"}
             ]
         })
     });

Modified: sandbox/foss4g2010/src/doc/wfs/layer.png
===================================================================
(Binary files differ)

Modified: sandbox/foss4g2010/src/doc/wfs/layer.rst
===================================================================
--- sandbox/foss4g2010/src/doc/wfs/layer.rst	2010-08-02 14:34:12 UTC (rev 2254)
+++ sandbox/foss4g2010/src/doc/wfs/layer.rst	2010-08-02 15:00:51 UTC (rev 2255)
@@ -45,7 +45,8 @@
             fields: [
                 {name: "LANAME", type: "string"},
                 {name: "CFCC", type: "string"},
-                {name: "LAND", type: "float"}
+                {name: "LAND", type: "float"},
+		{name: "AREA", type: "int", defaultValue: 10000}
             ],
             layer: layer
         });



More information about the Commits mailing list