From 1e0ddcedc16143881a15af3779ff62c674b8aa8b Mon Sep 17 00:00:00 2001 From: Larissa Smith Date: Wed, 20 Jul 2016 16:43:53 -0600 Subject: [PATCH] Added an option to addTiledImage to change the crossOriginPolicy. addTiledImage will also check the tileSource for crossOriginPolicy. --- src/viewer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/viewer.js b/src/viewer.js index fa9e33fe..f5654667 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1229,6 +1229,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * browsers that support the HTML5 canvas. * @param {Number} [options.opacity] Opacity the tiled image should be drawn at by default. * @param {String} [options.compositeOperation] How the image is composited onto other images. + * @param {String} [options.crossOriginPolicy] The crossOriginPolicy for this specific image, + * overriding viewer.crossOriginPolicy. * @param {Function} [options.success] A function that gets called when the image is * successfully added. It's passed the event object which contains a single property: * "item", the resulting TiledImage. @@ -1264,6 +1266,9 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, if (options.compositeOperation === undefined) { options.compositeOperation = this.compositeOperation; } + if (options.crossOriginPolicy === undefined) { + options.crossOriginPolicy = options.tileSource.crossOriginPolicy ? options.tileSource.crossOriginPolicy : this.crossOriginPolicy; + } var myQueueItem = { options: options @@ -1376,7 +1381,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, minPixelRatio: _this.minPixelRatio, smoothTileEdgesMinZoom: _this.smoothTileEdgesMinZoom, iOSDevice: _this.iOSDevice, - crossOriginPolicy: _this.crossOriginPolicy, + crossOriginPolicy: queueItem.options.crossOriginPolicy, debugMode: _this.debugMode });