[Commits] r257 - in sandbox/opengeo/geoexplorer/lib: . GeoExt/data

commits at geoext.org commits at geoext.org
Tue Mar 24 00:40:14 CET 2009


Author: tschaub
Date: 2009-03-24 00:40:14 +0100 (Tue, 24 Mar 2009)
New Revision: 257

Added:
   sandbox/opengeo/geoexplorer/lib/GeoExt/data/WMSCapabilitiesStore.js
Modified:
   sandbox/opengeo/geoexplorer/lib/GeoExt.js
Log:
adding a wms capabilities store (see #9)

Added: sandbox/opengeo/geoexplorer/lib/GeoExt/data/WMSCapabilitiesStore.js
===================================================================
--- sandbox/opengeo/geoexplorer/lib/GeoExt/data/WMSCapabilitiesStore.js	                        (rev 0)
+++ sandbox/opengeo/geoexplorer/lib/GeoExt/data/WMSCapabilitiesStore.js	2009-03-23 23:40:14 UTC (rev 257)
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2008 The Open Planning Project
+ */
+
+/**
+ * @include GeoExt/data/WMSCapabilitiesReader.js
+ */
+
+Ext.namespace("GeoExt.data");
+/**
+ * Class: GeoExt.data.WMSCapabilitiesStore
+ * Small helper class to make creating stores for remote WMS layer data easier.
+ *     WMSCapabilitiesStore is pre-configured with a built-in
+ *     {Ext.data.HttpProxy} and {GeoExt.data.WMSCapabilitiesReader}.  The
+ *     HttpProxy is configured to allow caching (disableCaching: false) and uses
+ *     GET.  If you require some other proxy/reader combination then you'll have
+ *     to configure this with your own proxy or create a basic
+ *     GeoExt.data.LayerStore and configure as needed.
+ *
+ * Extends:
+ *  - GeoExt.data.LayerStore
+ */
+
+/**
+ * Constructor: GeoExt.data.WMSCapabilitiesStore
+ * Create a new WMS capabilities store object.
+ *
+ * Parameters:
+ * config - {Object} Store configuration.
+ *
+ * Configuration options:
+ * format - {OpenLayers.Format} A parser for transforming the XHR response into
+ *     an array of objects representing attributes.  Defaults to an
+ *     {OpenLayers.Format.WMSCapabilities} parser.
+ * fields - {Array | Function} Either an Array of field definition objects as
+ *     passed to Ext.data.Record.create, or a Record constructor created using
+ *     Ext.data.Record.create.  Defaults to ["name", "type"]. 
+ */
+GeoExt.data.WMSCapabilitiesStore = function(c) {
+    GeoExt.data.WMSCapabilitiesStore.superclass.constructor.call(
+        this,
+        Ext.apply(c, {
+            proxy: c.proxy || (!c.data ?
+                new Ext.data.HttpProxy({url: c.url, disableCaching: false, method: "GET"}) :
+                undefined
+            ),
+            reader: new GeoExt.data.WMSCapabilitiesReader(
+                c, c.fields
+            )
+        })
+    );
+};
+Ext.extend(GeoExt.data.WMSCapabilitiesStore, GeoExt.data.LayerStore);

Modified: sandbox/opengeo/geoexplorer/lib/GeoExt.js
===================================================================
--- sandbox/opengeo/geoexplorer/lib/GeoExt.js	2009-03-23 23:39:10 UTC (rev 256)
+++ sandbox/opengeo/geoexplorer/lib/GeoExt.js	2009-03-23 23:40:14 UTC (rev 257)
@@ -64,6 +64,7 @@
             "GeoExt/data/LayerRecord.js",
             "GeoExt/data/LayerStoreMediator.js",
             "GeoExt/data/ProtocolProxy.js",
+            "GeoExt/data/WMSCapabilitiesStore.js",
             "GeoExt/data/WMSCapabilitiesReader.js",
             "GeoExt/widgets/MapPanel.js",
             "GeoExt/widgets/tree/TristateCheckboxNode.js",



More information about the Commits mailing list