Replace goog.array.contains with ol.array.includes
This commit is contained in:
@@ -16,6 +16,7 @@ goog.require('goog.string');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.FeatureStyleFunction');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.color');
|
||||
goog.require('ol.format.Feature');
|
||||
goog.require('ol.format.XMLFeature');
|
||||
@@ -683,7 +684,7 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
||||
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(goog.array.contains(
|
||||
goog.asserts.assert(ol.array.includes(
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
'namespaceURI of the node should be known to the KML parser');
|
||||
goog.asserts.assert(node.localName == 'coord', 'localName should be coord');
|
||||
@@ -716,7 +717,7 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
||||
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(goog.array.contains(
|
||||
goog.asserts.assert(ol.array.includes(
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
'namespaceURI of the node should be known to the KML parser');
|
||||
goog.asserts.assert(node.localName == 'MultiTrack',
|
||||
@@ -742,7 +743,7 @@ ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
|
||||
ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(goog.array.contains(
|
||||
goog.asserts.assert(ol.array.includes(
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
'namespaceURI of the node should be known to the KML parser');
|
||||
goog.asserts.assert(node.localName == 'Track', 'localName should be Track');
|
||||
@@ -1777,7 +1778,7 @@ ol.format.KML.prototype.readFeature;
|
||||
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
if (!goog.array.contains(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return null;
|
||||
}
|
||||
goog.asserts.assert(node.localName == 'Placemark',
|
||||
@@ -1810,7 +1811,7 @@ ol.format.KML.prototype.readFeatures;
|
||||
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
if (!goog.array.contains(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return [];
|
||||
}
|
||||
var features;
|
||||
@@ -1895,14 +1896,14 @@ ol.format.KML.prototype.readNameFromDocument = function(doc) {
|
||||
ol.format.KML.prototype.readNameFromNode = function(node) {
|
||||
var n;
|
||||
for (n = node.firstElementChild; !goog.isNull(n); n = n.nextElementSibling) {
|
||||
if (goog.array.contains(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
n.localName == 'name') {
|
||||
return ol.format.XSD.readString(n);
|
||||
}
|
||||
}
|
||||
for (n = node.firstElementChild; !goog.isNull(n); n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
if (goog.array.contains(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
(localName == 'Document' ||
|
||||
localName == 'Folder' ||
|
||||
localName == 'Placemark' ||
|
||||
@@ -1964,7 +1965,7 @@ ol.format.KML.prototype.readNetworkLinksFromDocument = function(doc) {
|
||||
ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
|
||||
var n, networkLinks = [];
|
||||
for (n = node.firstElementChild; !goog.isNull(n); n = n.nextElementSibling) {
|
||||
if (goog.array.contains(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
n.localName == 'NetworkLink') {
|
||||
var obj = ol.xml.pushParseAndPop({}, ol.format.KML.NETWORK_LINK_PARSERS_,
|
||||
n, []);
|
||||
@@ -1973,7 +1974,7 @@ ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
|
||||
}
|
||||
for (n = node.firstElementChild; !goog.isNull(n); n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
if (goog.array.contains(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
(localName == 'Document' ||
|
||||
localName == 'Folder' ||
|
||||
localName == 'kml')) {
|
||||
|
||||
Reference in New Issue
Block a user