Changeset 278


Ignore:
Timestamp:
03/26/09 07:29:39 (9 years ago)
Author:
tschaub
Message:

Adding relevant fields to layer records from capabilities docs.

Location:
sandbox/opengeo/geoexplorer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox/opengeo/geoexplorer/examples/wms-capabilities.js

    r271 r278  
    1 
     1var store;
    22Ext.onReady(function() {
    33   
    44    // create a new WMS capabilities store
    5     var store = new GeoExt.data.WMSCapabilitiesStore({
     5    store = new GeoExt.data.WMSCapabilitiesStore({
    66        url: "data/wmscap.xml"
    77    });
     
    1616            {header: "Title", dataIndex: "title", sortable: true},
    1717            {header: "Name", dataIndex: "name", sortable: true},
    18             {id: "description", header: "Description", dataIndex: "abstract"},
     18            {header: "Queryable", dataIndex: "queryable", sortable: true, width: 70},
     19            {id: "description", header: "Description", dataIndex: "abstract"}
    1920        ],
    2021        autoExpandColumn: "description",
    2122        renderTo: "capgrid",
    2223        height: 300,
    23         width: 600,
     24        width: 650,
    2425        listeners: {
    2526            rowdblclick: mapPreview
  • sandbox/opengeo/geoexplorer/lib/GeoExt/data/WMSCapabilitiesReader.js

    r265 r278  
    2323 * recordType - {Array | Ext.data.Record} An array of field configuration
    2424 *     objects or a record object.  Default is <GeoExt.data.LayerRecord>.
    25  *     TODO: only works with LayerRecord right now (see #27).
    2625 *
    2726 * Configuration options (meta properties):
     
    3534        meta.format = new OpenLayers.Format.WMSCapabilities();
    3635    }
     36    if(!(typeof recordType === "function")) {
     37        recordType = GeoExt.data.LayerRecord.create(
     38            recordType || meta.fields || [
     39                {name: "name", type: "string"},
     40                {name: "abstract", type: "string"},
     41                {name: "queryable", type: "boolean"},
     42                {name: "formats"},
     43                {name: "styles"},
     44                {name: "llbbox"},
     45                {name: "minScale"},
     46                {name: "maxScale"},
     47                {name: "prefix"}
     48            ]
     49        );
     50    }
    3751    GeoExt.data.WMSCapabilitiesReader.superclass.constructor.call(
    38         this, meta, recordType || meta.fields || GeoExt.data.LayerRecord
     52        this, meta, recordType
    3953    );
    4054};
Note: See TracChangeset for help on using the changeset viewer.