mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 22:56:11 +03:00
Merge pull request #364 from sul-dlss/cors-policy
add crossOriginPolicy drawer configuration to enable or disable CORS image requests
This commit is contained in:
commit
184ba0dbea
@ -101,7 +101,8 @@ $.Drawer = function( options ) {
|
|||||||
alwaysBlend: $.DEFAULT_SETTINGS.alwaysBlend,
|
alwaysBlend: $.DEFAULT_SETTINGS.alwaysBlend,
|
||||||
minPixelRatio: $.DEFAULT_SETTINGS.minPixelRatio,
|
minPixelRatio: $.DEFAULT_SETTINGS.minPixelRatio,
|
||||||
debugMode: $.DEFAULT_SETTINGS.debugMode,
|
debugMode: $.DEFAULT_SETTINGS.debugMode,
|
||||||
timeout: $.DEFAULT_SETTINGS.timeout
|
timeout: $.DEFAULT_SETTINGS.timeout,
|
||||||
|
crossOriginPolicy: $.DEFAULT_SETTINGS.crossOriginPolicy
|
||||||
|
|
||||||
}, options );
|
}, options );
|
||||||
|
|
||||||
@ -325,7 +326,10 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{
|
|||||||
this.downloading++;
|
this.downloading++;
|
||||||
|
|
||||||
image = new Image();
|
image = new Image();
|
||||||
image.crossOrigin = 'Anonymous';
|
|
||||||
|
if (_this.crossOriginPolicy !== false) {
|
||||||
|
image.crossOrigin = _this.crossOriginPolicy;
|
||||||
|
}
|
||||||
|
|
||||||
complete = function( imagesrc, resultingImage ){
|
complete = function( imagesrc, resultingImage ){
|
||||||
_this.downloading--;
|
_this.downloading--;
|
||||||
|
@ -409,6 +409,10 @@
|
|||||||
*
|
*
|
||||||
* @property {Number} [collectionTileSize=800]
|
* @property {Number} [collectionTileSize=800]
|
||||||
*
|
*
|
||||||
|
* @property {String} [crossOriginPolicy='Anonymous']
|
||||||
|
* Valid values are 'Anonymous', 'use-credentials', and false. If false, canvas requests will
|
||||||
|
* not use CORS, and the canvas will be tainted.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -723,6 +727,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
tileSources: null,
|
tileSources: null,
|
||||||
tileHost: null,
|
tileHost: null,
|
||||||
initialPage: 0,
|
initialPage: 0,
|
||||||
|
crossOriginPolicy: 'Anonymous',
|
||||||
|
|
||||||
//PAN AND ZOOM SETTINGS AND CONSTRAINTS
|
//PAN AND ZOOM SETTINGS AND CONSTRAINTS
|
||||||
panHorizontal: true,
|
panHorizontal: true,
|
||||||
|
@ -1921,7 +1921,8 @@ function openTileSource( viewer, source ) {
|
|||||||
minPixelRatio: _this.collectionMode ? 0 : _this.minPixelRatio,
|
minPixelRatio: _this.collectionMode ? 0 : _this.minPixelRatio,
|
||||||
timeout: _this.timeout,
|
timeout: _this.timeout,
|
||||||
debugMode: _this.debugMode,
|
debugMode: _this.debugMode,
|
||||||
debugGridColor: _this.debugGridColor
|
debugGridColor: _this.debugGridColor,
|
||||||
|
crossOriginPolicy: _this.crossOriginPolicy
|
||||||
});
|
});
|
||||||
_this.drawers = [_this.drawer];
|
_this.drawers = [_this.drawer];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user