Merge pull request #1639 from twpayne/kml-ie9

KML support for Internet Explorer
This commit is contained in:
Tom Payne
2014-02-05 14:23:07 +01:00
6 changed files with 174 additions and 59 deletions

View File

@@ -4,12 +4,13 @@
goog.provide('ol.source.VectorFile');
goog.require('goog.asserts');
goog.require('goog.dom.xml');
goog.require('goog.net.XhrIo');
goog.require('goog.userAgent');
goog.require('ol.format.FormatType');
goog.require('ol.proj');
goog.require('ol.source.State');
goog.require('ol.source.Vector');
goog.require('ol.xml');
@@ -88,9 +89,11 @@ ol.source.VectorFile.prototype.handleXhrIo_ = function(event) {
} else if (type == ol.format.FormatType.TEXT) {
source = xhrIo.getResponseText();
} else if (type == ol.format.FormatType.XML) {
source = xhrIo.getResponseXml();
if (goog.isNull(source)) {
source = goog.dom.xml.loadXml(xhrIo.getResponseText());
if (!goog.userAgent.IE) {
source = xhrIo.getResponseXml();
}
if (!goog.isDefAndNotNull(source)) {
source = ol.xml.load(xhrIo.getResponseText());
}
} else {
goog.asserts.fail();