gxp.plugins.WMSCSource¶
-
class
gxp.plugins.WMSCSource(config)¶ Plugin for using WMS-C layers with
gxp.Viewerinstances. The plugin issues a GetCapabilities request to create a store of the WMS’s layers. If tilesets are available, it will use them.
Example Use¶
Configuration in the gxp.Viewer:
defaultSourceType: "gxp_wmscsource",
sources: {
"opengeo": {
url: "http://suite.opengeo.org/geoserver/wms"
}
}
A typical configuration for a layer from this source (in the layers
array of the viewer’s map config option would look like this:
{
source: "opengeo",
name: "world",
group: "background"
}
Config Options¶
Configuration properties in addition to those listed for Ext.util.Observable.
-
baseParams ObjectBase parameters to use on the WMS GetCapabilities request.
-
requiredProperties Array(String)List of config properties that are required for each layer from this source to allow lazy loading. Default is["title", "bbox"]. When the source loads layers from a WMS-C that does not use subsets of the default Web Mercator grid, not provide tiles for all default Web Mercator resolutions, and not use a tileSize of 256x256 pixels,tileOrigin,resolutionsandtileSizeshould be included in this list.
-
url StringWMS service URL for this source
-
version StringOnly WMS 1.1.1 is supported at the moment.
Public Properties¶
Public properties in addition to those listed for Ext.util.Observable.
BooleanSet to true if you don’t want this LayerSource to show up in the AddLayers dialog. Defaults to false.
-
WMSCSource.lazy¶ Boolean. true when the source is ready, but its store hasn’t been loaded yet (i.e. lazy source). Read-only.
-
WMSCSource.requiredProperties¶ Array(String)List of config properties that are required for a complete layer configuration, in addition toname.
-
WMSCSource.store¶ GeoExt.data.LayerStore
-
WMSCSource.title¶ StringA descriptive title for this layer source.
Public Methods¶
Public methods in addition to those listed for Ext.util.Observable.
-
WMSCSource.createLayerRecord()¶ Parameters: config – ObjectThe application config for this layer.Returns: GeoExt.data.LayerRecordor null when the source is lazy.Create a layer record given the config. Applications should check that the source is not
lazy`or that theconfigis complete (i.e. configured with all fields listed inrequiredPropertiesbefore using this method. Otherwise, it is recommended to use the asynchronousgxp.Viewer.createLayerRecord()method on the target viewer instead, which will load the source’s store to complete the configuration if necessary.
-
WMSCSource.createStore()¶ Creates a store of layer records. Fires “ready” when store is loaded.
-
WMSCSource.describeLayer()¶ Parameters: - rec –
GeoExt.data.LayerRecordthe layer to issue a WMS DescribeLayer request for - callback –
FunctionCallback function. Will be called with anExt.data.Recordfrom aGeoExt.data.DescribeLayerStoreas first argument, or false if the WMS does not support DescribeLayer. - scope –
ObjectOptional scope for the callback.
Get a DescribeLayer response from this source’s WMS.
- rec –
-
WMSCSource.getConfigForRecord()¶ Parameters: record – GeoExt.data.LayerRecordReturns: ObjectCreate a config object that can be used to recreate the given record.
-
WMSCSource.getProjection()¶ Parameters: layerRecord – GeoExt.data.LayerRecorda record from this source’s storeReturns: OpenLayers.ProjectionA suitable projection for thelayerRecord. If the layer is available in the map projection, the map projection will be returned. Otherwise an equal projection, or null if none is available.Get the projection that the source will use for the layer created in
createLayerRecord. If the layer is not available in a projection that fits the map projection, null will be returned.
-
WMSCSource.getSchema()¶ Parameters: - rec –
GeoExt.data.LayerRecordthe WMS layer to issue a WFS DescribeFeatureType request for - callback –
FunctionCallback function. Will be called with aGeoExt.data.AttributeStorecontaining the schema as first argument, or false if the WMS does not support DescribeLayer or the layer is not associated with a WFS feature type. - scope –
ObjectOptional scope for the callback.
Gets the schema for a layer of this source, if the layer is a feature layer.
- rec –
-
WMSCSource.getState()¶ Returns: ObjectGets the configured source state.
-
WMSCSource.getWFSProtocol()¶ Parameters: - record –
GeoExt.data.LayerRecord - callback –
Function - scope –
Object
Returns: OpenLayers.Protocol.WFSCreates a WFS protocol for the given WMS layer record.
- record –
-
WMSCSource.init()¶ Parameters: target – ObjectThe object initializing this plugin.
Events¶
Events in addition to those listed for Ext.util.Observable.
-
failure Fires if the layer source fails to load.
-
ready Fires when the layer source is ready for action.