Update iiiftilesource.js

This commit is contained in:
radix-pro 2013-07-02 00:02:48 -07:00
parent 0441cfe4ec
commit a4303fb232

View File

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