Merge pull request #4164 from spatialillusions/patch-1

This commit is contained in:
Andreas Hocevar
2015-10-02 11:11:08 +02:00

View File

@@ -425,6 +425,9 @@ ol.style.IconImage_ = function(image, src, size, crossOrigin, imageState) {
* @type {boolean}
*/
this.tainting_ = false;
if (this.imageState_ == ol.style.ImageState.LOADED) {
this.determineTainting_();
}
};
goog.inherits(ol.style.IconImage_, goog.events.EventTarget);
@@ -455,8 +458,8 @@ ol.style.IconImage_.get = function(image, src, size, crossOrigin, imageState) {
*/
ol.style.IconImage_.prototype.determineTainting_ = function() {
var context = ol.dom.createCanvasContext2D(1, 1);
context.drawImage(this.image_, 0, 0);
try {
context.drawImage(this.image_, 0, 0);
context.getImageData(0, 0, 1, 1);
} catch (e) {
this.tainting_ = true;