mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
add crossOriginPolicy drawer configuration to enable or disable CORS image requests
This commit is contained in:
parent
1643660f17
commit
3d028716fe
@ -100,7 +100,8 @@ $.Drawer = function( options ) {
|
||||
alwaysBlend: $.DEFAULT_SETTINGS.alwaysBlend,
|
||||
minPixelRatio: $.DEFAULT_SETTINGS.minPixelRatio,
|
||||
debugMode: $.DEFAULT_SETTINGS.debugMode,
|
||||
timeout: $.DEFAULT_SETTINGS.timeout
|
||||
timeout: $.DEFAULT_SETTINGS.timeout,
|
||||
crossOriginPolicy: $.DEFAULT_SETTINGS.crossOriginPolicy
|
||||
|
||||
}, options );
|
||||
|
||||
@ -303,7 +304,10 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{
|
||||
this.downloading++;
|
||||
|
||||
image = new Image();
|
||||
image.crossOrigin = 'Anonymous';
|
||||
|
||||
if (_this.crossOriginPolicy !== false) {
|
||||
image.crossOrigin = _this.crossOriginPolicy;
|
||||
}
|
||||
|
||||
complete = function( imagesrc, resultingImage ){
|
||||
_this.downloading--;
|
||||
|
@ -403,6 +403,10 @@
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -717,6 +721,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
tileSources: null,
|
||||
tileHost: null,
|
||||
initialPage: 0,
|
||||
crossOriginPolicy: 'Anonymous',
|
||||
|
||||
//PAN AND ZOOM SETTINGS AND CONSTRAINTS
|
||||
panHorizontal: true,
|
||||
|
@ -1662,7 +1662,8 @@ function openTileSource( viewer, source ) {
|
||||
minPixelRatio: _this.collectionMode ? 0 : _this.minPixelRatio,
|
||||
timeout: _this.timeout,
|
||||
debugMode: _this.debugMode,
|
||||
debugGridColor: _this.debugGridColor
|
||||
debugGridColor: _this.debugGridColor,
|
||||
crossOriginPolicy: _this.crossOriginPolicy
|
||||
});
|
||||
|
||||
// Now that we have a drawer, see if it supports rotate. If not we need to remove the rotate buttons
|
||||
|
Loading…
Reference in New Issue
Block a user