Changeset 311


Ignore:
Timestamp:
04/01/09 19:05:55 (8 years ago)
Author:
sbenthall
Message:

capabilities grid window now persists and is shown/hidden instead of created
and destroyed. the WMSCapabilitiesStore is now created by the
CapabilitiesGrid itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js

    r310 r311  
    5151
    5252    /**
     53     * Property: capGrid
     54     * {<Ext.Window>} A window which includes a CapabilitiesGrid panel.
     55     */
     56    capGrid: null,
     57
     58
     59    /**
    5360     * Property: load
    5461     * Called at the end of construction.  This initiates the sequence that
     
    7077        // create the layers store
    7178        this.initLayers();
    72         this.initWMSStore();
    7379
    7480        var toolbarItems = this.initMapControlsAndToolbar();
     
    8591            zoom: mapConfig.zoom
    8692        });
     93
     94        this.initCapabilitiesGrid();
    8795
    8896        var layersContainer = new Ext.Panel({
     
    203211    },
    204212
    205     initWMSStore: function(){
    206         this.wmsStore =  new GeoExt.data.WMSCapabilitiesStore({
    207             url: this.ows + "?service=wms&request=GetCapabilities"
    208         });
    209 
    210         this.wmsStore.load();
    211     },
    212 
    213     showCapabilitiesGrid: function(){
    214 
    215         var win = new Ext.Window({
     213    initCapabilitiesGrid: function(){
     214
     215        var capGridPanel = new CapabilitiesGrid({
     216            url : this.ows,
     217            mapPanel : this.mapPanel,
     218            height: 300,
     219            width: 650
     220        })
     221
     222        this.capGrid = new Ext.Window({
    216223            title: "Available Layers",
     224            closeAction: 'hide',
    217225            items: [
    218                 new CapabilitiesGrid({
    219                     store : this.wmsStore,
    220                     mapPanel : this.mapPanel,
    221                     height: 300,
    222                     width: 650
    223                 })
     226                capGridPanel
    224227            ],
    225228            bbar: ["->",
     
    227230                       text: "Done",
    228231                       handler: function() {
    229                            win.close();
    230                        }
     232                           this.capGrid.hide();
     233                       },
     234                       scope: this
    231235                   })
    232236                  ]
    233237        });
    234 
    235         win.show();
     238    },
     239
     240    showCapabilitiesGrid: function(){
     241        this.capGrid.show();
    236242    },
    237243
Note: See TracChangeset for help on using the changeset viewer.