mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Fix hash tile generation by checking the validity of URL input parameter and fallback to level, x, y variables.
This commit is contained in:
parent
298f069c7e
commit
61c77a3440
@ -688,11 +688,14 @@ $.TileSource.prototype = {
|
||||
* @param {*} postData data the tile was fetched with (type depends on getTilePostData(..) return type)
|
||||
*/
|
||||
getTileHashKey: function(level, x, y, url, ajaxHeaders, postData) {
|
||||
if (ajaxHeaders) {
|
||||
return url + "+" + JSON.stringify(ajaxHeaders);
|
||||
} else {
|
||||
return url;
|
||||
function withHeaders(hash) {
|
||||
return ajaxHeaders ? hash + "+" + JSON.stringify(ajaxHeaders) : hash;
|
||||
}
|
||||
|
||||
if (typeof url !== "string") {
|
||||
return withHeaders(level + "/" + x + "_" + y);
|
||||
}
|
||||
return withHeaders(url);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1398,11 +1398,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
options.ajaxHeaders = $.extend({}, this.ajaxHeaders, options.ajaxHeaders);
|
||||
}
|
||||
|
||||
if (!$.isFunction(options.tileSource.getTileHashKey)) {
|
||||
//silently add custom implementation
|
||||
options.tileSource.getTileHashKey = $.TileSource.prototype.getTileHashKey;
|
||||
}
|
||||
|
||||
var myQueueItem = {
|
||||
options: options
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user