Handle JSONP errors in ol.source.TileJSON

Fixes #3938
This commit is contained in:
Frederic Junod
2015-08-10 14:21:16 +02:00
parent daf85c75c7
commit 0578e8f2f6
2 changed files with 25 additions and 2 deletions

View File

@@ -1,4 +1,3 @@
// FIXME add some error checking
// FIXME check order of async callbacks
/**
@@ -41,7 +40,8 @@ ol.source.TileJSON = function(options) {
});
var request = new goog.net.Jsonp(options.url);
request.send(undefined, goog.bind(this.handleTileJSONResponse, this));
request.send(undefined, goog.bind(this.handleTileJSONResponse, this),
goog.bind(this.handleTileJSONError, this));
};
goog.inherits(ol.source.TileJSON, ol.source.TileImage);
@@ -100,3 +100,11 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
this.setState(ol.source.State.READY);
};
/**
* @protected
*/
ol.source.TileJSON.prototype.handleTileJSONError = function() {
this.setState(ol.source.State.ERROR);
};