From f22495871c83bbe480e096a2d6663bb9bbbe546b Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 4 Feb 2014 15:43:10 +0100 Subject: [PATCH] Use ol.xml.isNode in ol.format.XML --- src/ol/format/xmlformat.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ol/format/xmlformat.js b/src/ol/format/xmlformat.js index ab92f2b13e..7e0dc19ec1 100644 --- a/src/ol/format/xmlformat.js +++ b/src/ol/format/xmlformat.js @@ -33,8 +33,8 @@ ol.format.XML.prototype.getType = function() { ol.format.XML.prototype.readFeature = function(source) { if (ol.xml.isDocument(source)) { return this.readFeatureFromDocument(/** @type {Document} */ (source)); - } else if (source instanceof Node) { - return this.readFeatureFromNode(source); + } else if (ol.xml.isNode(source)) { + return this.readFeatureFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { var doc = ol.xml.load(source); return this.readFeatureFromDocument(doc); @@ -72,8 +72,8 @@ ol.format.XML.prototype.readFeatureFromNode = goog.abstractMethod; ol.format.XML.prototype.readFeatures = function(source) { if (ol.xml.isDocument(source)) { return this.readFeaturesFromDocument(/** @type {Document} */ (source)); - } else if (source instanceof Node) { - return this.readFeaturesFromNode(source); + } else if (ol.xml.isNode(source)) { + return this.readFeaturesFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { var doc = ol.xml.load(source); return this.readFeaturesFromDocument(doc); @@ -116,8 +116,8 @@ ol.format.XML.prototype.readFeaturesFromNode = goog.abstractMethod; ol.format.XML.prototype.readGeometry = function(source) { if (ol.xml.isDocument(source)) { return this.readGeometryFromDocument(/** @type {Document} */ (source)); - } else if (source instanceof Node) { - return this.readGeometryFromNode(source); + } else if (ol.xml.isNode(source)) { + return this.readGeometryFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { var doc = ol.xml.load(source); return this.readGeometryFromDocument(doc); @@ -150,8 +150,8 @@ ol.format.XML.prototype.readGeometryFromNode = goog.abstractMethod; ol.format.XML.prototype.readProjection = function(source) { if (ol.xml.isDocument(source)) { return this.readProjectionFromDocument(/** @type {Document} */ (source)); - } else if (source instanceof Node) { - return this.readProjectionFromNode(source); + } else if (ol.xml.isNode(source)) { + return this.readProjectionFromNode(/** @type {Node} */ (source)); } else if (goog.isString(source)) { var doc = ol.xml.load(source); return this.readProjectionFromDocument(doc);