src/legacytilesource.js
function filterFiles( files ){
    var filtered = [],
        file,
        i;
    for( i = 0; i < files.length; i++ ){
        file = files[ i ];
        if( file.height &&
            file.width &&
            file.url ){
            //This is sufficient to serve as a level
            filtered.push({
                url: file.url,
                width: Number( file.width ),
                height: Number( file.height )
            });
        }
        else {
            $.console.error( 'Unsupported image format: %s', file.url ? file.url : '<no URL>' );
        }
    }

    return filtered.sort(function(a, b) {
        return a.height - b.height;
    });

}
function filterFiles( files ){
    var filtered = [],
        file,
        i;
    for( i = 0; i < files.length; i++ ){
        file = files[ i ];
        if( file.height &&
            file.width &&
            file.url ){
            //This is sufficient to serve as a level
            filtered.push({
                url: file.url,
                width: Number( file.width ),
                height: Number( file.height )
            });
        }
        else {
            $.console.error( 'Unsupported image format: %s', file.url ? file.url : '<no URL>' );
        }
    }

    return filtered.sort(function(a, b) {
        return a.height - b.height;
    });

}
function filterFiles ( files ) { var filtered = [ ] , file , i ; for ( i = 0 ; i < files . length ; i ++ ) { file = files [ i ] ; if ( file . height && file . width && file . url ) { //This is sufficient to serve as a level filtered . push ( { url : file . url , width : Number ( file . width ) , height : Number ( file . height ) } ) ; } else { $ . console . error ( 'Unsupported image format: %s' , file . url ? file . url : '<no URL>' ) ; } } return filtered . sort ( function ( a , b ) { return a . height - b . height ; } ) ; }
This method removes any files from the Array which don't conform to our
basic requirements for a 'level' in the LegacyTileSource.
@private
@inner
@function
This method removes any files from the Array which don t conform to our basic requirements for a level in the LegacyTileSource .