diff --git a/src/viewer.js b/src/viewer.js index 04073c46..3a7f7539 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -221,41 +221,11 @@ $.Viewer = function( options ) { $.ControlDock.call( this, options ); //Deal with tile sources - var initialTileSource; - if ( this.xmlPath ){ //Deprecated option. Now it is preferred to use the tileSources option this.tileSources = [ this.xmlPath ]; } - if ( this.tileSources ){ - // tileSources is a complex option... - // - // It can be a string, object, or an array of any of strings and objects. - // At this point we only care about if it is an Array or not. - // - if( $.isArray( this.tileSources ) ){ - - //must be a sequence of tileSource since the first item - //is a legacy tile source - if( this.tileSources.length > 1 ){ - THIS[ this.hash ].sequenced = true; - } - - //Keeps the initial page within bounds - if ( this.initialPage > this.tileSources.length - 1 ){ - this.initialPage = this.tileSources.length - 1; - } - - initialTileSource = this.tileSources[ this.initialPage ]; - - //Update the sequence (aka currrent page) property - THIS[ this.hash ].sequence = this.initialPage; - } else { - initialTileSource = this.tileSources; - } - } - this.element = this.element || document.getElementById( this.id ); this.canvas = $.makeNeutralElement( "div" ); this.keyboardCommandArea = $.makeNeutralElement( "textarea" ); @@ -540,8 +510,8 @@ $.Viewer = function( options ) { } // Open initial tilesources - if ( initialTileSource ) { - this.open( initialTileSource ); + if ( this.tileSources ) { + this.open( this.tileSources ); if ( this.tileSources.length > 1 ) { this._updateSequenceButtons( this.initialPage ); diff --git a/test/demo/collections/main.js b/test/demo/collections/main.js index 9b5e0966..68920e03 100644 --- a/test/demo/collections/main.js +++ b/test/demo/collections/main.js @@ -6,15 +6,31 @@ init: function() { var self = this; + var tileSources = [ + { + tileSource: "../../data/tall.dzi", + x: 1.5, + y: 0, + width: 1 + }, { + tileSource: '../../data/wide.dzi', + opacity: 1, + x: 0, + y: 1.5, + height: 1 + } + ]; + this.viewer = OpenSeadragon( { // debugMode: true, zoomPerScroll: 1.02, showNavigator: true, id: "contentDiv", + tileSources: tileSources, prefixUrl: "../../../build/openseadragon/images/" } ); - this.crossTest3(); + // this.crossTest3(); }, // ----------