implement versioned format base class, r=ahocevar (closes #2954)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12155 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -32,31 +32,6 @@ OpenLayers.Format.WMC = OpenLayers.Class(OpenLayers.Format.Context, {
|
||||
* this instance.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Method: getParser
|
||||
* Get the WMC parser given a version. Create a new parser if it does not
|
||||
* already exist.
|
||||
*
|
||||
* Parameters:
|
||||
* version - {String} The version of the parser.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Format.WMC.v1>} A WMC parser.
|
||||
*/
|
||||
getParser: function(version) {
|
||||
var v = version || this.version || this.defaultVersion;
|
||||
if(!this.parser || this.parser.VERSION != v) {
|
||||
var format = OpenLayers.Format.WMC[
|
||||
"v" + v.replace(/\./g, "_")
|
||||
];
|
||||
if(!format) {
|
||||
throw "Can't find a WMC parser for version " + v;
|
||||
}
|
||||
this.parser = new format(this.options);
|
||||
}
|
||||
return this.parser;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: layerToContext
|
||||
* Create a layer context object given a wms layer object.
|
||||
|
||||
Reference in New Issue
Block a user