[Commits] r1962 - in sandbox/mapgears/geoext.ux/ux/WMSLayerAdder: examples lib/GeoExt.ux/widgets

commits at geoext.org commits at geoext.org
Mon Mar 15 19:45:44 CET 2010


Author: adube
Date: 2010-03-15 19:45:44 +0100 (Mon, 15 Mar 2010)
New Revision: 1962

Modified:
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
Log:
wmslayeradder - mapPreview and bbar

Modified: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js	2010-03-15 18:19:24 UTC (rev 1961)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/examples/WMSLayerAdderExample.js	2010-03-15 18:45:44 UTC (rev 1962)
@@ -27,7 +27,7 @@
         title: OpenLayers.i18n("WMSLayerAdder"),
         region: "east",
         width: 500,
-        gridPanelOptions: {'height': 227},
+        gridPanelOptions: {'height': 210},
         serverStore: oServerStore,
         map: mapPanel.map
     });

Modified: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js	2010-03-15 18:19:24 UTC (rev 1961)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js	2010-03-15 18:45:44 UTC (rev 1962)
@@ -30,6 +30,8 @@
     bodyStyle:'padding:5px;',
     buttonAlign:'center',
 
+    useIcons: false,
+
     serverStore: null,
 
     serverStoreDisplayField: 'url',
@@ -55,6 +57,7 @@
             this.capabilitiesParams, this.defaultCapabilitiesParams);
 
         this.initMyItems();
+        this.initMyToolbar();
 
         arguments.callee.superclass.constructor.call(this, config);
     },
@@ -70,13 +73,12 @@
             region: 'north',
             id: "wms_field_group",
             xtype: 'fieldset',
-            //title: OpenLayers.i18n('WMS server information'),
             layout: 'form',
             border: false,
             collapsible: false,
             autoHeight: true,
             autoWidth: true,
-            defaults: {width: '100%', /*hideLabel: true*/},
+            defaults: {width: '100%'},
             defaultType: 'textfield',
             buttonAlign:'center',
             items: [],
@@ -228,6 +230,7 @@
         // In order to have a scrollbar, a GridPanel must have a 'height' set,
         // it can't be left with 'autoHeight': true...
         var options = {
+            id: 'wms_capabilities_grid_panel',
             columnWidth: 0.5,
             layout: 'fit',
             store: this.WMSCapabilitiesStore,
@@ -280,7 +283,7 @@
                 xtype: 'textarea',
                 fieldLabel: 'Abstract',
                 name: 'abstract',
-                anchor: '100% 0'
+                anchor: '100% -15'
             }]
         };
 
@@ -288,7 +291,53 @@
 
     },
 
-    mapPreview: function() {
-            alert(1);
+    mapPreview: function(grid, index) {
+        var record = grid.getStore().getAt(index);
+        var layer = record.get("layer").clone();
+        
+        var win = new Ext.Window({
+            title: OpenLayers.i18n('Preview') + ": " + record.get("title"),
+            width: 512,
+            height: 256,
+            layout: "fit",
+            items: [{
+                xtype: "gx_mappanel",
+                layers: [layer],
+                extent: record.get("llbbox")
+            }]
+        });
+        win.show();
     },
+
+    initMyToolbar: function() {
+        var items = [];
+
+        items.push('->');
+
+        // AddLayer action
+        var actionOptions = {
+            handler: this.addLayers,
+            scope: this,
+            tooltip: OpenLayers.i18n('Add currently selected layers')
+        };
+
+        if (this.useIcons === true) {
+            actionOptions.iconCls = "gx-wmslayeradder-addlayer";
+        } else {
+            actionOptions.text = OpenLayers.i18n('Add layers');
+        }
+
+        var action = new Ext.Action(actionOptions);
+        items.push(action);
+
+        // Cancel action... todo
+
+
+        Ext.apply(this, {bbar: new Ext.Toolbar(items)});
+    },
+
+    addLayers: function() {
+        var grid = Ext.getCmp('wms_capabilities_grid_panel');
+    }
+
 });



More information about the Commits mailing list