Less intrusive version fallback

This commit is contained in:
ahocevar
2012-10-02 16:07:35 +02:00
parent e326a9ea2f
commit 3d1b0f0bd9
2 changed files with 5 additions and 5 deletions

View File

@@ -116,3 +116,8 @@ OpenLayers.Format.WMSDescribeLayer.v1_1 = OpenLayers.Class(
CLASS_NAME: "OpenLayers.Format.WMSDescribeLayer.v1_1" CLASS_NAME: "OpenLayers.Format.WMSDescribeLayer.v1_1"
}); });
// Version aliases - workaround for http://trac.osgeo.org/mapserver/ticket/2257
OpenLayers.Format.WMSDescribeLayer.v1_1_1 =
OpenLayers.Format.WMSDescribeLayer.v1_1_0 =
OpenLayers.Format.WMSDescribeLayer.v1_1;

View File

@@ -127,11 +127,6 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, {
var format = OpenLayers.Format[this.name][ var format = OpenLayers.Format[this.name][
"v" + version.replace(/\./g, "_") + profile "v" + version.replace(/\./g, "_") + profile
]; ];
if (!format && ~version.indexOf('.')) {
// falling back to less specific parser
return this.getParser(
version.substr(0, version.lastIndexOf('.')));
}
if(!format) { if(!format) {
throw "Can't find a " + this.name + " parser for version " + throw "Can't find a " + this.name + " parser for version " +
version + profile; version + profile;