Improve XHR and ol.net.jsonp result/failure handling

This commit is contained in:
Andreas Hocevar
2016-02-02 17:53:49 +01:00
parent e48ab95735
commit 78f44dcc8a
4 changed files with 27 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ ol.source.TileJSON = function(options) {
var xhr = new XMLHttpRequest();
xhr.open('GET', options.url, true);
xhr.onload = function(e) {
if (xhr.status < 400) {
if (xhr.status >= 200 && xhr.status < 300) {
var response = /** @type {TileJSON} */(JSON.parse(xhr.responseText));
this.handleTileJSONResponse(response);
} else {