mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +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)
|
* @param {*} postData data the tile was fetched with (type depends on getTilePostData(..) return type)
|
||||||
*/
|
*/
|
||||||
getTileHashKey: function(level, x, y, url, ajaxHeaders, postData) {
|
getTileHashKey: function(level, x, y, url, ajaxHeaders, postData) {
|
||||||
if (ajaxHeaders) {
|
function withHeaders(hash) {
|
||||||
return url + "+" + JSON.stringify(ajaxHeaders);
|
return ajaxHeaders ? hash + "+" + JSON.stringify(ajaxHeaders) : hash;
|
||||||
} else {
|
|
||||||
return url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
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