Make ol.format.XML a @struct

And replace the undeclared `this.version` by a local variable.
This commit is contained in:
Frederic Junod
2016-02-11 16:30:05 +01:00
parent 4e11a86b4e
commit ac17a2f2a7
2 changed files with 4 additions and 3 deletions

View File

@@ -66,13 +66,13 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Capabilities',
'localName should be Capabilities');
this.version = node.getAttribute('version').trim();
goog.asserts.assertString(this.version, 'this.version should be a string');
var version = node.getAttribute('version').trim();
goog.asserts.assertString(version, 'version should be a string');
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
if (!WMTSCapabilityObject) {
return null;
}
WMTSCapabilityObject['version'] = this.version;
WMTSCapabilityObject['version'] = version;
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
ol.format.WMTSCapabilities.PARSERS_, node, []);
return WMTSCapabilityObject ? WMTSCapabilityObject : null;

View File

@@ -9,6 +9,7 @@ goog.require('ol.xml');
* Generic format for reading non-feature XML data
*
* @constructor
* @struct
*/
ol.format.XML = function() {
};