source:
trunk/workshop-routing-foss4g/web/GeoExt/lib/GeoExt/data/WMSCapabilitiesStore.js
@
81
Revision 76, 2.0 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Rev | Line | |
---|---|---|
[76] | 1 | /** |
2 | * Copyright (c) 2008-2010 The Open Source Geospatial Foundation | |
3 | * | |
4 | * Published under the BSD license. | |
5 | * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text | |
6 | * of the license. | |
7 | */ | |
8 | ||
9 | /** | |
10 | * @include GeoExt/data/WMSCapabilitiesReader.js | |
11 | */ | |
12 | ||
13 | /** api: (define) | |
14 | * module = GeoExt.data | |
15 | * class = WMSCapabilitiesStore | |
16 | * base_link = `Ext.data.Store <http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.Store>`_ | |
17 | */ | |
18 | Ext.namespace("GeoExt.data"); | |
19 | ||
20 | /** api: constructor | |
21 | * .. class:: WMSCapabilitiesStore | |
22 | * | |
23 | * Small helper class to make creating stores for remote WMS layer data | |
24 | * easier. The store is pre-configured with a built-in | |
25 | * ``Ext.data.HttpProxy`` and :class:`GeoExt.data.WMSCapabilitiesReader`. | |
26 | * The proxy is configured to allow caching and issues requests via GET. | |
27 | * If you require some other proxy/reader combination then you'll have to | |
28 | * configure this with your own proxy or create a basic | |
29 | * :class:`GeoExt.data.LayerStore` and configure as needed. | |
30 | */ | |
31 | ||
32 | /** api: config[format] | |
33 | * ``OpenLayers.Format`` | |
34 | * A parser for transforming the XHR response into an array of objects | |
35 | * representing attributes. Defaults to an ``OpenLayers.Format.WMSCapabilities`` | |
36 | * parser. | |
37 | */ | |
38 | ||
39 | /** api: config[fields] | |
40 | * ``Array | Function`` | |
41 | * Either an Array of field definition objects as passed to | |
42 | * ``Ext.data.Record.create``, or a record constructor created using | |
43 | * ``Ext.data.Record.create``. Defaults to ``["name", "type"]``. | |
44 | */ | |
45 | ||
46 | GeoExt.data.WMSCapabilitiesStore = function(c) { | |
47 | c = c || {}; | |
48 | GeoExt.data.WMSCapabilitiesStore.superclass.constructor.call( | |
49 | this, | |
50 | Ext.apply(c, { | |
51 | proxy: c.proxy || (!c.data ? | |
52 | new Ext.data.HttpProxy({url: c.url, disableCaching: false, method: "GET"}) : | |
53 | undefined | |
54 | ), | |
55 | reader: new GeoExt.data.WMSCapabilitiesReader( | |
56 | c, c.fields | |
57 | ) | |
58 | }) | |
59 | ); | |
60 | }; | |
61 | Ext.extend(GeoExt.data.WMSCapabilitiesStore, Ext.data.Store); |
Note: See TracBrowser
for help on using the repository browser.