From 749dacc74918698980f5263ba21dce36fbbc513e Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 17 Nov 2015 12:36:29 +0100 Subject: [PATCH] Allow '' for crossOrigin (as Anonymous alias) This fixes a regression introduced by the goog.isDef removal. From the HTML 5 spec: "The empty string is also a valid keyword, and maps to the Anonymous state" --- src/ol/image.js | 2 +- src/ol/imagetile.js | 2 +- src/ol/style/iconstyle.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/image.js b/src/ol/image.js index 398f2af1ec..6b426d962c 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -38,7 +38,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src, * @type {HTMLCanvasElement|Image|HTMLVideoElement} */ this.image_ = new Image(); - if (crossOrigin) { + if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; } diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index 131be58b27..74dfaa3953 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -37,7 +37,7 @@ ol.ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction) { * @type {Image} */ this.image_ = new Image(); - if (crossOrigin) { + if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; } diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js index ad52456147..8417b08a9d 100644 --- a/src/ol/style/iconstyle.js +++ b/src/ol/style/iconstyle.js @@ -392,7 +392,7 @@ ol.style.IconImage_ = function(image, src, size, crossOrigin, imageState) { */ this.image_ = !image ? new Image() : image; - if (crossOrigin) { + if (crossOrigin !== null) { this.image_.crossOrigin = crossOrigin; }