Merge pull request #725 from fs-webdev/master

Added 'tile-load-failed' event
This commit is contained in:
Ian Gilman 2015-09-15 10:25:31 -07:00
commit e4b33623fa

View File

@ -1023,6 +1023,18 @@ function loadTile( tiledImage, tile, time ) {
function onTileLoad( tiledImage, tile, time, image, errorMsg ) { function onTileLoad( tiledImage, tile, time, image, errorMsg ) {
if ( !image ) { if ( !image ) {
$.console.log( "Tile %s failed to load: %s - error: %s", tile, tile.url, errorMsg ); $.console.log( "Tile %s failed to load: %s - error: %s", tile, tile.url, errorMsg );
/**
* Triggered when a tile fails to load.
*
* @event tile-open-failed
* @memberof OpenSeadragon.Viewer
* @type {object}
* @property {OpenSeadragon.TiledImage} tiledImage - The tiled image of the unloaded tile.
* @property {OpenSeadragon.Tile} tile - The tile that failed to load.
* @property {number} time - The time in milliseconds when the tile load began.
* @property {string} message - The error message.
*/
tiledImage.viewer.raiseEvent("tile-load-failed", {tile: tile, tiledImage: tiledImage, time: time, message: errorMsg});
if( !tiledImage.debugMode ){ if( !tiledImage.debugMode ){
tile.loading = false; tile.loading = false;
tile.exists = false; tile.exists = false;