leaflet-gpx
leaflet-gpx copied to clipboard
IE8 compatibility
On IE8 the XML isn't loaded into the responseXML
object of the XMLHttpRequest but in response
with the content type set to text/xml
. The loading handler should be changed to something like this:
req.onreadystatechange = function() {
if (req.readyState != 4) return;
if (req.status == 200) {
if (req.responseXML) {
cb(req.responseXML, options);
} else {
try{
var parser = new DOMParser();
cb(parser.parseFromString(req.response, "text/xml"), options);
} catch (e) {
console.log(e);
}
}
}
};
Hi, please also follow the discussion here: http://www.wpquestions.com/question/show/id/8754 I had to fork your code as I implemented a php proxy to load gpx files from external domains to overcome cross-domain limitations - not all code for fixing IE8 might be usable out of the box. best, Robert