mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Change missing cacheKey in Tilesource constructor to warning. Provide default implementation of getTileHashKey for tileSource if the tileSource does not inherit from OpenSeadragon.TileSource
This commit is contained in:
parent
12402f2f0f
commit
298f069c7e
@ -129,7 +129,7 @@ $.Tile = function(level, x, y, bounds, exists, url, context2D, loadWithAjax, aja
|
|||||||
this.ajaxHeaders = ajaxHeaders;
|
this.ajaxHeaders = ajaxHeaders;
|
||||||
|
|
||||||
if (cacheKey === undefined) {
|
if (cacheKey === undefined) {
|
||||||
$.console.error("Tile constructor needs 'cacheKey' variable: creation tile cache" +
|
$.console.warn("Tile constructor needs 'cacheKey' variable: creation tile cache" +
|
||||||
" in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used.");
|
" in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used.");
|
||||||
cacheKey = $.TileSource.prototype.getTileHashKey(level, x, y, url, ajaxHeaders, postData);
|
cacheKey = $.TileSource.prototype.getTileHashKey(level, x, y, url, ajaxHeaders, postData);
|
||||||
}
|
}
|
||||||
|
@ -1398,6 +1398,11 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
options.ajaxHeaders = $.extend({}, this.ajaxHeaders, options.ajaxHeaders);
|
options.ajaxHeaders = $.extend({}, this.ajaxHeaders, options.ajaxHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$.isFunction(options.tileSource.getTileHashKey)) {
|
||||||
|
//silently add custom implementation
|
||||||
|
options.tileSource.getTileHashKey = $.TileSource.prototype.getTileHashKey;
|
||||||
|
}
|
||||||
|
|
||||||
var myQueueItem = {
|
var myQueueItem = {
|
||||||
options: options
|
options: options
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user