Make ol.format.XML a @struct
And replace the undeclared `this.version` by a local variable.
This commit is contained in:
@@ -66,13 +66,13 @@ ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
|
|||||||
'node.nodeType should be ELEMENT');
|
'node.nodeType should be ELEMENT');
|
||||||
goog.asserts.assert(node.localName == 'Capabilities',
|
goog.asserts.assert(node.localName == 'Capabilities',
|
||||||
'localName should be Capabilities');
|
'localName should be Capabilities');
|
||||||
this.version = node.getAttribute('version').trim();
|
var version = node.getAttribute('version').trim();
|
||||||
goog.asserts.assertString(this.version, 'this.version should be a string');
|
goog.asserts.assertString(version, 'version should be a string');
|
||||||
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
|
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
|
||||||
if (!WMTSCapabilityObject) {
|
if (!WMTSCapabilityObject) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
WMTSCapabilityObject['version'] = this.version;
|
WMTSCapabilityObject['version'] = version;
|
||||||
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
|
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
|
||||||
ol.format.WMTSCapabilities.PARSERS_, node, []);
|
ol.format.WMTSCapabilities.PARSERS_, node, []);
|
||||||
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
|
return WMTSCapabilityObject ? WMTSCapabilityObject : null;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ goog.require('ol.xml');
|
|||||||
* Generic format for reading non-feature XML data
|
* Generic format for reading non-feature XML data
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
|
* @struct
|
||||||
*/
|
*/
|
||||||
ol.format.XML = function() {
|
ol.format.XML = function() {
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user