Merge pull request #4900 from fredj/ol.format.XML_struct

Make ol.format.XML a @struct
This commit is contained in:
Frédéric Junod
2016-02-24 14:24:39 +01:00
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() {
};