diff --git a/src/imageLoader.js b/src/imageLoader.js index f1d5265d..0fa658a2 100644 --- a/src/imageLoader.js +++ b/src/imageLoader.js @@ -94,14 +94,16 @@ ImageJob.prototype = { * @memberof OpenSeadragon * @classdesc Handles downloading of a set of images using asynchronous queue pattern. * You generally won't have to interact with the ImageLoader directly. + * @param {Object} options - Options for this ImageLoader. + * @param {Number} options.jobLimit - The number of concurrent image requests. */ -$.ImageLoader = function() { +$.ImageLoader = function( options ) { $.extend( true, this, { jobLimit: $.DEFAULT_SETTINGS.imageLoaderLimit, jobQueue: [], jobsInProgress: 0 - }); + }, options ); }; @@ -166,4 +168,3 @@ function completeJob( loader, job, callback ) { } }( OpenSeadragon )); - diff --git a/src/viewer.js b/src/viewer.js index 00108538..f6650203 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -436,7 +436,9 @@ $.Viewer = function( options ) { this.viewport.setHomeBounds(this.world.getHomeBounds(), this.world.getContentFactor()); // Create the image loader - this.imageLoader = new $.ImageLoader(); + this.imageLoader = new $.ImageLoader({ + jobLimit: this.imageLoaderLimit + }); // Create the tile cache this.tileCache = new $.TileCache({