fixed IIIF options.maxLevel

This commit is contained in:
Zsolt Ero 2018-02-16 21:09:56 +01:00
parent 01408a4744
commit 8e06e5eb39

View File

@ -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);
}
}