mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 00:26:10 +03:00
Added 'tile-open-failed' event to notify the app when a tile fails to load.
This can happen when the image has authentication or other restrictions.
This commit is contained in:
parent
63c066b6e5
commit
dd8baa1639
@ -1023,6 +1023,18 @@ function loadTile( tiledImage, tile, time ) {
|
||||
function onTileLoad( tiledImage, tile, time, image, errorMsg ) {
|
||||
if ( !image ) {
|
||||
$.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 which has been unloaded.
|
||||
* @property {number} time - The current time in milliseconds when the tile load began.
|
||||
* @property {string} message - The error message.
|
||||
*/
|
||||
tiledImage.viewer.raiseEvent("tile-open-failed", {tile: tile, tiledImage: tiledImage, time: time, message: errorMsg});
|
||||
if( !tiledImage.debugMode ){
|
||||
tile.loading = false;
|
||||
tile.exists = false;
|
||||
|
Loading…
Reference in New Issue
Block a user