From a4303fb23267e7bcdcacdda887a698ecd97e4df1 Mon Sep 17 00:00:00 2001 From: radix-pro Date: Tue, 2 Jul 2013 00:02:48 -0700 Subject: [PATCH] Update iiiftilesource.js --- src/iiiftilesource.js | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index 802e932c..1649a096 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -63,27 +63,19 @@ $.IIIFTileSource = function( options ){ // to store it. It may be possible to make tileSize a vector // OpenSeadraon.Point but would require careful implementation // to preserve backward compatibility. - options.tileSize = this.tile_width; - - 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; + options.tileSize = this.tile_width; + 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; } } - } - if ( mf < 0 ) { - options.maxLevel = Number( Math.ceil( Math.log( Math.max( this.width, this.height ), 2 ))); - } else { - options.maxLevel = mf; - } - } - + if ( mf < 0 ) options.maxLevel = Number(Math.ceil(Math.log(Math.max(this.width, this.height ), 2))); + else options.maxLevel = mf; + } $.TileSource.apply( this, [ options ] ); };