diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index 0af45c8b..c80a3f2d 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -127,7 +127,8 @@ $.IIIFTileSource = function( options ){ if (!this.scale_factors) { options.maxLevel = Number(Math.ceil(Math.log(Math.max(this.width, this.height), 2))); } else { - options.maxLevel = Math.floor(Math.pow(Math.max.apply(null, this.scale_factors), 0.5)); + var maxScaleFactor = Math.max.apply(null, this.scale_factors); + options.maxLevel = Math.round(Math.log(maxScaleFactor) * Math.LOG2E); } }