Remove ol.xml.getLocalName workaround for IE
This property is available for IE >= 9
This commit is contained in:
@@ -111,7 +111,7 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
||||
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
var features;
|
||||
if (localName == 'FeatureCollection') {
|
||||
if (node.namespaceURI === 'http://www.opengis.net/wfs') {
|
||||
@@ -219,7 +219,7 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
||||
ol.xml.getAttributeNS(node, ol.format.GMLBase.GMLNS, 'id');
|
||||
var values = {}, geometryName;
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
var localName = n.localName;
|
||||
// Assume attribute elements have one child node and that the child
|
||||
// is a text or CDATA node (to be treated as text).
|
||||
// Otherwise assume it is a geometry node.
|
||||
|
||||
@@ -1745,7 +1745,7 @@ ol.format.KML.prototype.getExtensions = function() {
|
||||
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
|
||||
'localName should be Document or Folder');
|
||||
// FIXME use scope somehow
|
||||
@@ -1923,7 +1923,7 @@ ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
return [];
|
||||
}
|
||||
var features;
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
if (localName == 'Document' || localName == 'Folder') {
|
||||
features = this.readDocumentOrFolder_(
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
@@ -2009,7 +2009,7 @@ ol.format.KML.prototype.readNameFromNode = function(node) {
|
||||
}
|
||||
}
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
var localName = n.localName;
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
(localName == 'Document' ||
|
||||
localName == 'Folder' ||
|
||||
@@ -2080,7 +2080,7 @@ ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
|
||||
}
|
||||
}
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
var localName = n.localName;
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
(localName == 'Document' ||
|
||||
localName == 'Folder' ||
|
||||
|
||||
@@ -75,7 +75,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
|
||||
node.setAttribute('namespaceURI', this.featureNS_);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = [];
|
||||
if (node.childNodes.length === 0) {
|
||||
|
||||
@@ -114,41 +114,6 @@ ol.xml.getAllTextContent_ = function(node, normalizeWhitespace, accumulator) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @private
|
||||
* @return {string} Local name.
|
||||
*/
|
||||
ol.xml.getLocalName_ = function(node) {
|
||||
return node.localName;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @private
|
||||
* @return {string} Local name.
|
||||
*/
|
||||
ol.xml.getLocalNameIE_ = function(node) {
|
||||
var localName = node.localName;
|
||||
if (localName !== undefined) {
|
||||
return localName;
|
||||
}
|
||||
var baseName = node.baseName;
|
||||
goog.asserts.assert(baseName,
|
||||
'Failed to get localName/baseName of node %s', node);
|
||||
return baseName;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {string} Local name.
|
||||
*/
|
||||
ol.xml.getLocalName = goog.userAgent.IE ?
|
||||
ol.xml.getLocalNameIE_ : ol.xml.getLocalName_;
|
||||
|
||||
|
||||
/**
|
||||
* @param {?} value Value.
|
||||
* @private
|
||||
|
||||
Reference in New Issue
Block a user