IE 10 not reading DZI file correctly

IE 10 is treating the data coming back from the JSONP request as a
string and not as XML. I have confirmed this issue is happening on
numerous IE10 machines but have not seen it on any other browser.

The change simply checks the type of the data variable and if it is a
string it parses the string as XML and updates the data object.
This commit is contained in:
gwills 2013-09-07 17:08:39 +01:00
parent 75ddd299e4
commit 2bef2e882f

View File

@ -299,6 +299,10 @@ $.TileSource.prototype = {
} }
callback = function( data ){ callback = function( data ){
if( typeof(data) === "string" ) {
var tmp = new DOMParser();
data = tmp.parseFromString( data , "text/xml" );
}
var $TileSource = $.TileSource.determineType( _this, data, url ); var $TileSource = $.TileSource.determineType( _this, data, url );
if ( !$TileSource ) { if ( !$TileSource ) {
_this.raiseEvent( 'open-failed', { message: "Unable to load TileSource", source: url } ); _this.raiseEvent( 'open-failed', { message: "Unable to load TileSource", source: url } );