[Commits] r330 - sandbox/opengeo/geoexplorer/examples

commits at geoext.org commits at geoext.org
Thu Apr 2 21:16:40 CEST 2009


Author: tschaub
Date: 2009-04-02 21:16:40 +0200 (Thu, 02 Apr 2009)
New Revision: 330

Modified:
   sandbox/opengeo/geoexplorer/examples/wms-capabilities2.html
   sandbox/opengeo/geoexplorer/examples/wms-capabilities2.js
Log:
Removing the redundant description column, adding a map panel, and making the example a bit more functional.

Modified: sandbox/opengeo/geoexplorer/examples/wms-capabilities2.html
===================================================================
--- sandbox/opengeo/geoexplorer/examples/wms-capabilities2.html	2009-04-02 19:10:30 UTC (rev 329)
+++ sandbox/opengeo/geoexplorer/examples/wms-capabilities2.html	2009-04-02 19:16:40 UTC (rev 330)
@@ -21,6 +21,9 @@
         <p>Note that the js is not minified so it is readable.
         See <a href="wms-capabilities2.js">wms-capabilities.js</a>.</p>
 
-        <div id="capgrid"></div>
+        <div style="position: relative;">
+            <div id="capgrid"></div>
+            <div id="mappanel"></div>
+        </div>
     </body>
 </html>

Modified: sandbox/opengeo/geoexplorer/examples/wms-capabilities2.js
===================================================================
--- sandbox/opengeo/geoexplorer/examples/wms-capabilities2.js	2009-04-02 19:10:30 UTC (rev 329)
+++ sandbox/opengeo/geoexplorer/examples/wms-capabilities2.js	2009-04-02 19:16:40 UTC (rev 330)
@@ -1,4 +1,4 @@
-var store;
+var store, panel;
 Ext.onReady(function() {
     
     // create a new WMS capabilities store
@@ -25,17 +25,45 @@
         cm: new xg.ColumnModel([
             expander,
             {header: "Name", dataIndex: "name", sortable: true},
-            {header: "Title", dataIndex: "title", sortable: true},
-            {header: "Queryable", dataIndex: "queryable", sortable: true, width: 70},
-            {id: "description", header: "Description", dataIndex: "abstract"}
+            {id: "title", header: "Title", dataIndex: "title", sortable: true}
         ]),
-        iconCls: 'icon-grid',
-        autoExpandColumn: "description",
+        sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
+        autoExpandColumn: "title",
         renderTo: "capgrid",
         plugins: expander, 
         height: 300,
-        width: 650,
+        width: 350,
+        floating: true,
+        x: 10,
+        y: 0,
+        bbar: ["->", {
+            text: "Add Layer",
+            handler: function() {
+                var record = grid.getSelectionModel().getSelected();
+                if(record) {
+                    record = record.copy();
+                    record.get("layer").mergeNewParams({
+                        format: "image/png",
+                        transparent: "true"
+                    });
+                    panel.layers.add(record);
+                    panel.map.zoomToExtent(
+                        OpenLayers.Bounds.fromArray(record.get("llbbox"))
+                    );
+                }
+            }
+        }]
     });
     
+    // create a map panel
+    panel = new GeoExt.MapPanel({
+        renderTo: "mappanel",
+        width: 350,
+        height: 300,
+        floating: true,
+        x: 400,
+        y: 0
+    });
+    
 
 });



More information about the Commits mailing list