fix for #1209 (Reference strip using "thumbs")

This commit is contained in:
Robert Saric 2017-07-06 21:59:26 +02:00
parent 51cf6201cf
commit 413e40a64c
2 changed files with 12 additions and 1 deletions

View File

@ -50,6 +50,7 @@
* @extends OpenSeadragon.TileSource * @extends OpenSeadragon.TileSource
* @param {Object} options Options object. * @param {Object} options Options object.
* @param {String} options.url URL of the image * @param {String} options.url URL of the image
* @param {String} options.referenceStripThumbnailUrl URL of the dedicated thumbnail image
* @param {Boolean} [options.buildPyramid=true] If set to true (default), a * @param {Boolean} [options.buildPyramid=true] If set to true (default), a
* pyramid will be built internally to provide a better downsampling. * pyramid will be built internally to provide a better downsampling.
* @param {String|Boolean} [options.crossOriginPolicy=false] Valid values are * @param {String|Boolean} [options.crossOriginPolicy=false] Valid values are

View File

@ -428,9 +428,19 @@ function loadPanels( strip, viewerSize, scroll ) {
for ( i = activePanelsStart; i < activePanelsEnd && i < strip.panels.length; i++ ) { for ( i = activePanelsStart; i < activePanelsEnd && i < strip.panels.length; i++ ) {
element = strip.panels[i]; element = strip.panels[i];
if ( !element.activePanel ) { if ( !element.activePanel ) {
var miniTileSource;
var originalTileSource = strip.viewer.tileSources[i];
if (originalTileSource.referenceStripThumbnailUrl) {
miniTileSource = {
type: 'image',
url: originalTileSource.referenceStripThumbnailUrl
};
} else {
miniTileSource = originalTileSource;
}
miniViewer = new $.Viewer( { miniViewer = new $.Viewer( {
id: element.id, id: element.id,
tileSources: [strip.viewer.tileSources[i]], tileSources: [miniTileSource],
element: element, element: element,
navigatorSizeRatio: strip.sizeRatio, navigatorSizeRatio: strip.sizeRatio,
showNavigator: false, showNavigator: false,