Update iiiftilesource.js

This commit is contained in:
radix-pro 2013-07-02 13:41:37 -07:00
parent 3c7e4b794a
commit 004f13365d

View File

@ -67,14 +67,14 @@ $.IIIFTileSource = function( options ){
if (! options.maxLevel ) {
var mf = -1;
if ( this.scale_factor instanceof Array ) {
for ( var i = 0; i < this.scale_factor.length; i++ )
{
var cf = Number( this.scale_factor[i] );
if ( !isNaN(cf) && cf > mf ) { mf = cf; }
var scfs = this.scale_factors || this.scale_factor;
if ( scfs instanceof Array ) {
for ( var i = 0; i < scfs.length; i++ ) {
var cf = Number( scfs[i] );
if ( !isNaN( cf ) && cf > mf ) { mf = cf; }
}
}
if ( mf < 0 ) { options.maxLevel = Number( Math.ceil( Math.log( Math.max( this.width, this.height ), 2 ))); }
if ( mf < 0 ) { options.maxLevel = Number(Math.ceil(Math.log(Math.max(this.width, this.height), 2))); }
else { options.maxLevel = mf; }
}