[OpenLayers-Commits] r11056 - in trunk/openlayers: lib
lib/OpenLayers/Format tests
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Mon Jan 24 07:20:36 EST 2011
Author: bartvde
Date: 2011-01-24 04:20:36 -0800 (Mon, 24 Jan 2011)
New Revision: 11056
Modified:
trunk/openlayers/lib/OpenLayers.js
trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities.js
trunk/openlayers/tests/list-tests.html
Log:
add support for parsing WMS-C type capabilities, r=ahocevar (closes #3026)
Modified: trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities.js 2011-01-24 10:12:16 UTC (rev 11055)
+++ trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities.js 2011-01-24 12:20:36 UTC (rev 11056)
@@ -29,6 +29,15 @@
version: null,
/**
+ * APIProperty: profile
+ * {String} If provided, use a custom profile.
+ *
+ * Currently supported profiles:
+ * - WMSC - parses vendor specific capabilities for WMS-C.
+ */
+ profile: null,
+
+ /**
* Property: parser
* {<OpenLayers.Format>} A cached versioned format used for reading.
*/
@@ -63,12 +72,14 @@
}
var root = data.documentElement;
var version = this.version || root.getAttribute("version") || this.defaultVersion;
+ var profile = this.profile ? "_" + this.profile : "";
if(!this.parser || this.parser.version !== version) {
var constr = OpenLayers.Format.WMSCapabilities[
- "v" + version.replace(/\./g, "_")
+ "v" + version.replace(/\./g, "_") + profile
];
if(!constr) {
- throw "Can't find a WMS capabilities parser for version " + version;
+ throw "Can't find a WMS capabilities parser for version " +
+ version + profile;
}
this.parser = new constr(this.options);
}
Modified: trunk/openlayers/lib/OpenLayers.js
===================================================================
--- trunk/openlayers/lib/OpenLayers.js 2011-01-24 10:12:16 UTC (rev 11055)
+++ trunk/openlayers/lib/OpenLayers.js 2011-01-24 12:20:36 UTC (rev 11056)
@@ -285,6 +285,7 @@
"OpenLayers/Format/WMSCapabilities/v1_1_1.js",
"OpenLayers/Format/WMSCapabilities/v1_3.js",
"OpenLayers/Format/WMSCapabilities/v1_3_0.js",
+ "OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js",
"OpenLayers/Format/WMSGetFeatureInfo.js",
"OpenLayers/Format/SOSCapabilities.js",
"OpenLayers/Format/SOSCapabilities/v1_0_0.js",
Modified: trunk/openlayers/tests/list-tests.html
===================================================================
--- trunk/openlayers/tests/list-tests.html 2011-01-24 10:12:16 UTC (rev 11055)
+++ trunk/openlayers/tests/list-tests.html 2011-01-24 12:20:36 UTC (rev 11056)
@@ -83,6 +83,7 @@
<li>Format/WMC/v1.html</li>
<li>Format/WMSCapabilities.html</li>
<li>Format/WMSCapabilities/v1_1_1.html</li>
+ <li>Format/WMSCapabilities/v1_1_1_WMSC.html</li>
<li>Format/WMSCapabilities/v1_3_0.html</li>
<li>Format/WMSDescribeLayer.html</li>
<li>Format/WMSGetFeatureInfo.html</li>
More information about the Commits
mailing list