add support for parsing WMS-C type capabilities, r=ahocevar (closes #3026)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11056 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -285,6 +285,7 @@
|
|||||||
"OpenLayers/Format/WMSCapabilities/v1_1_1.js",
|
"OpenLayers/Format/WMSCapabilities/v1_1_1.js",
|
||||||
"OpenLayers/Format/WMSCapabilities/v1_3.js",
|
"OpenLayers/Format/WMSCapabilities/v1_3.js",
|
||||||
"OpenLayers/Format/WMSCapabilities/v1_3_0.js",
|
"OpenLayers/Format/WMSCapabilities/v1_3_0.js",
|
||||||
|
"OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js",
|
||||||
"OpenLayers/Format/WMSGetFeatureInfo.js",
|
"OpenLayers/Format/WMSGetFeatureInfo.js",
|
||||||
"OpenLayers/Format/SOSCapabilities.js",
|
"OpenLayers/Format/SOSCapabilities.js",
|
||||||
"OpenLayers/Format/SOSCapabilities/v1_0_0.js",
|
"OpenLayers/Format/SOSCapabilities/v1_0_0.js",
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ OpenLayers.Format.WMSCapabilities = OpenLayers.Class(OpenLayers.Format.XML, {
|
|||||||
*/
|
*/
|
||||||
version: null,
|
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
|
* Property: parser
|
||||||
* {<OpenLayers.Format>} A cached versioned format used for reading.
|
* {<OpenLayers.Format>} A cached versioned format used for reading.
|
||||||
@@ -63,12 +72,14 @@ OpenLayers.Format.WMSCapabilities = OpenLayers.Class(OpenLayers.Format.XML, {
|
|||||||
}
|
}
|
||||||
var root = data.documentElement;
|
var root = data.documentElement;
|
||||||
var version = this.version || root.getAttribute("version") || this.defaultVersion;
|
var version = this.version || root.getAttribute("version") || this.defaultVersion;
|
||||||
|
var profile = this.profile ? "_" + this.profile : "";
|
||||||
if(!this.parser || this.parser.version !== version) {
|
if(!this.parser || this.parser.version !== version) {
|
||||||
var constr = OpenLayers.Format.WMSCapabilities[
|
var constr = OpenLayers.Format.WMSCapabilities[
|
||||||
"v" + version.replace(/\./g, "_")
|
"v" + version.replace(/\./g, "_") + profile
|
||||||
];
|
];
|
||||||
if(!constr) {
|
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);
|
this.parser = new constr(this.options);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
<li>Format/WMC/v1.html</li>
|
<li>Format/WMC/v1.html</li>
|
||||||
<li>Format/WMSCapabilities.html</li>
|
<li>Format/WMSCapabilities.html</li>
|
||||||
<li>Format/WMSCapabilities/v1_1_1.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/WMSCapabilities/v1_3_0.html</li>
|
||||||
<li>Format/WMSDescribeLayer.html</li>
|
<li>Format/WMSDescribeLayer.html</li>
|
||||||
<li>Format/WMSGetFeatureInfo.html</li>
|
<li>Format/WMSGetFeatureInfo.html</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user