diff --git a/changelog.txt b/changelog.txt index 98a94fd0..d0aa0ebb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ OPENSEADRAGON CHANGELOG ======================= -2.0.0: (in progress) +1.3.0: (in progress) * True multi-image mode (#450) * BREAKING CHANGE: Passing an array for the tileSources option is no longer enough to trigger sequence mode; you have to set the sequenceMode option to true as well @@ -40,7 +40,11 @@ OPENSEADRAGON CHANGELOG * Overlays appear in the DOM immediately on open or addOverlay (#507) * imageLoaderLimit now works (#544) -1.2.0: (in progress) +1.2.1: (in progress) + +* Added preserveOverlays option (#561) + +1.2.0: * New combined IIIF TileSource for 1.0 through 2.0 (#441) * BREAKING CHANGE: Removed IIIF1_1TileSource (now that IIIFTileSource supports all versions) diff --git a/package.json b/package.json index 2b102600..97fb8b25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "OpenSeadragon", - "version": "1.1.1", + "version": "1.2.0", "description": "Provides a smooth, zoomable user interface for HTML/Javascript.", "devDependencies": { "grunt": "^0.4.5", diff --git a/src/openseadragon.js b/src/openseadragon.js index 07abcd42..9e164adf 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -517,6 +517,12 @@ * viewport to 'home' position. If preserveViewport is set to true, then the viewport * position is preserved when navigating between images in the sequence. * + * @property {Boolean} [preserveOverlays=false] + * If the viewer has been configured with a sequence of tile sources, then + * normally navigating to through each image resets the overlays. + * If preserveOverlays is set to true, then the overlays + * are preserved when navigating between images in the sequence. + * * @property {Boolean} [showReferenceStrip=false] * If sequenceMode is true, then display a scrolling strip of image thumbnails for * navigating through the images. @@ -952,6 +958,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ showSequenceControl: true, //SEQUENCE sequenceControlAnchor: null, //SEQUENCE preserveViewport: false, //SEQUENCE + preserveOverlays: false, //SEQUENCE navPrevNextWrap: false, //SEQUENCE showNavigationControl: true, //ZOOM/HOME/FULL/ROTATION navigationControlAnchor: null, //ZOOM/HOME/FULL/ROTATION diff --git a/src/viewer.js b/src/viewer.js index 781af981..0f19fc8f 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -622,8 +622,10 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, } // Global overlays - for ( var i = 0; i < _this.overlays.length; i++ ) { - _this.currentOverlays[ i ] = getOverlayObject( _this, _this.overlays[ i ] ); + if( _this.overlays && !_this.preserveOverlays ){ + for ( var i = 0; i < _this.overlays.length; i++ ) { + _this.currentOverlays[ i ] = getOverlayObject( _this, _this.overlays[ i ] ); + } } _this._drawOverlays(); @@ -734,8 +736,11 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, this.navigator.close(); } - this.clearOverlays(); - this.overlaysContainer.innerHTML = ""; + if( ! this.preserveOverlays) + { + this.clearOverlays(); + this.overlaysContainer.innerHTML = ""; + } THIS[ this.hash ].animating = false; this.world.removeAll();