[Commits] r232 - sandbox/opengeo/drake/trunk/apps/geoexplorer

commits at geoext.org commits at geoext.org
Wed Mar 18 19:18:00 CET 2009


Author: dwins
Date: 2009-03-18 19:18:00 +0100 (Wed, 18 Mar 2009)
New Revision: 232

Modified:
   sandbox/opengeo/drake/trunk/apps/geoexplorer/index.html
Log:
Add a LegendPanel and remove the extraneous layers that it exposed.


Modified: sandbox/opengeo/drake/trunk/apps/geoexplorer/index.html
===================================================================
--- sandbox/opengeo/drake/trunk/apps/geoexplorer/index.html	2009-03-18 17:54:06 UTC (rev 231)
+++ sandbox/opengeo/drake/trunk/apps/geoexplorer/index.html	2009-03-18 18:18:00 UTC (rev 232)
@@ -22,16 +22,14 @@
             GeoExplorer = {
                 load: function() {
                     this.map = new OpenLayers.Map();
-                    this.selectionLayer = new OpenLayers.Layer.Vector('Selection', { displayInLayerSwitcher: false});
                     this.map.addLayers([
                         new OpenLayers.Layer.WMS("TOPP States", 
                         '/geoserver/wms' ,{
-                            layers: 'topp:states,sf:restricted',
+                            layers: 'topp:states',
                             format: 'image/png'
                             }, {
                             isBaseLayer: true
-                        }),
-                        this.selectionLayer
+                        })
                     ]);
 
                     var identify = new OpenLayers.Control.WMSGetFeatureInfo('/geoserver/wms', {
@@ -82,6 +80,9 @@
                     });
 
                     this.layerTree = new Ext.tree.TreePanel({
+                        title: "Layers",
+                        width: 100,
+                        collapsible: true, 
                         region: 'west',
                         root: new GeoExt.tree.LayerContainer({
                             text: 'Map Layers',
@@ -89,9 +90,22 @@
                         })
                     });
 
+                    // TODO: Just a LegendPanel by itself caused some render issues,
+                    // investigate why the wrapping panel is required. -dwins
+                    this.legendPanel = new Ext.Panel({
+                        title: "Legend",
+                        region: "east",
+                        width: 250,
+                        collapsible: true,
+                        items: [new GeoExt.LegendPanel({
+                            border: false,
+                            map: this.map
+                        })]
+                    });
+
                     new Ext.Viewport({
                         layout: 'border',
-                        items: [this.mapPanel, this.layerTree]
+                        items: [this.layerTree, this.legendPanel, this.mapPanel]
                     });
                 },
             };



More information about the Commits mailing list