Don't rely on getResponseXml

This commit is contained in:
Tom Payne
2013-12-20 18:01:27 +01:00
parent d68a88da26
commit e183a2daf1

View File

@@ -3,6 +3,7 @@
goog.provide('ol.source.VectorFile');
goog.require('goog.asserts');
goog.require('goog.dom.xml');
goog.require('goog.net.XhrIo');
goog.require('ol.format.FormatType');
goog.require('ol.proj');
@@ -83,6 +84,9 @@ ol.source.VectorFile.prototype.handleXhrIo_ = function(event) {
source = xhrIo.getResponseText();
} else if (type == ol.format.FormatType.XML) {
source = xhrIo.getResponseXml();
if (goog.isNull(source)) {
source = goog.dom.xml.loadXml(xhrIo.getResponseText());
}
} else {
goog.asserts.fail();
}