Update iiiftilesource.js

This commit is contained in:
radix-pro 2013-07-02 00:41:22 -07:00
parent 8f8e028015
commit 3c7e4b794a

View File

@ -65,16 +65,16 @@ $.IIIFTileSource = function( options ){
// to preserve backward compatibility. // to preserve backward compatibility.
options.tileSize = this.tile_width; options.tileSize = this.tile_width;
if (! options.maxLevel) { if (! options.maxLevel ) {
var mf = -1; var mf = -1;
if (this.scale_factor instanceof Array) { if ( this.scale_factor instanceof Array ) {
for (var i = 0;i < this.scale_factor.length;i++) for ( var i = 0; i < this.scale_factor.length; i++ )
{ {
var cf = Number(this.scale_factor[i]); var cf = Number( this.scale_factor[i] );
if (!isNaN(cf) && cf > mf) { mf = cf; } 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; } else { options.maxLevel = mf; }
} }