Changeset 303


Ignore:
Timestamp:
03/31/09 16:30:25 (9 years ago)
Author:
sbenthall
Message:

CapabilitiesGrid now takes persisting GeoExplorer WMSStore. Also, some Natural
Docs.

Location:
apps/opengeo/geoexplorer/trunk/lib
Files:
2 edited

Legend:

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

    r301 r303  
     1/**
     2 * Class: CapabilitiesGrid
     3 * Create a new grid displaying the WMS cabilities of a URL,
     4 *     or the contents of a <GeoExt.data.WMSCabilitiesStore>.  The user can
     5 *     add layers to a passed in <GeoExt.MapPanel> from the grid.
     6 *
     7 * Extends:
     8 *  - <Ext.grid.GridPanel>
     9 */
     10
     11/**
     12 * Constructor: CapabilitiesGrid
     13 *     Creates a panel with a map inside it.
     14 *
     15 * Parameters:
     16 * config - {Object} A config object. In addition to the config options
     17 *     of its parent class, this object can receive specific options,
     18 *     see the API properties to know about these specific options.
     19 */
    120
    221var CapabilitiesGrid = Ext.extend(Ext.grid.GridPanel, {
     
    625    cm: null,
    726
     27    /**
     28     * APIProperty: mapPanel
     29     * {<GeoExt.MapPanel>} A MapPanel to which layers can be added
     30     *    via this grid.
     31     */
    832    mapPanel : null,
    933
    10     //this one is important; needs to be supplied
    11     //as configuration option
     34    /**
     35     * APIProperty: url
     36     * {String} An OWS url to which the GetCapabilities request is sent.
     37     * Necessary if a store is not passed in as a configuration option.
     38     */
    1239    url: null,
    1340
     
    1744    autoExpandColumn: "description",
    1845
     46    /**
     47     * Method: initComponent
     48     *
     49     * Initializes the CapabilitiesGrid. Creates and loads a WMS
     50     *     Capabilities store from the url property if one is not passed as a
     51     *     configuration option.
     52     */
    1953    initComponent: function(){
    2054
    21         this.store = new GeoExt.data.WMSCapabilitiesStore({
    22             url: this.url + "?service=wms&request=GetCapabilities"
    23         });
     55        if(!this.store){
     56            this.store = new GeoExt.data.WMSCapabilitiesStore({
     57                url: this.url + "?service=wms&request=GetCapabilities"
     58            });
    2459
    25         this.store.load();
     60            this.store.load();
     61        }
    2662
    2763        var expander = new Ext.grid.RowExpander({
     
    5086    },
    5187
    52    
     88    /**
     89     * Method: addLayer
     90     *
     91     * Adds a layer to the <GeoExt.MapPanel> of this instance.
     92     */   
    5393    addLayer : function(){
    5494
  • apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js

    r300 r303  
    5151
    5252    /**
     53     * Property: wmsStore
     54     * {<GeoExt.data.WMSCapabilitiesStore>} A store of WMS Capabilities records from the url provided by configuration.
     55
     56    /**
    5357     * Property: toolbarItems
    5458     * {Array} An array containing toolbar items suitable for passing as a tbar: property
     
    7781        // create the layers store
    7882        this.initLayers();
     83        this.initWMSStore();
    7984
    8085        this.initMapControls();
     
    211216    },
    212217
     218    initWMSStore: function(){
     219        this.wmsStore =  new GeoExt.data.WMSCapabilitiesStore({
     220            url: this.ows + "?service=wms&request=GetCapabilities"
     221        });
     222
     223        this.wmsStore.load();
     224    },
     225
    213226    showCapabilitiesGrid: function(){
    214227
     
    222235            items: [
    223236                new CapabilitiesGrid({
    224                     url : this.ows,
     237                    store : this.wmsStore,
    225238                    mapPanel : this.mapPanel
    226239                })
Note: See TracChangeset for help on using the changeset viewer.