From fb1c66525cef72fd2e595ea961763d6dd09bf97d Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sat, 1 Mar 2014 13:56:23 +0100 Subject: [PATCH] Catch CORS exceptions when loading icons --- src/ol/style/iconstyle.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js index ccfc83b7cd..3fa3033849 100644 --- a/src/ol/style/iconstyle.js +++ b/src/ol/style/iconstyle.js @@ -429,7 +429,11 @@ ol.style.IconImage_.prototype.load = function() { goog.events.listenOnce(this.image_, goog.events.EventType.LOAD, this.handleImageLoad_, false, this) ]; - this.image_.src = this.src_; + try { + this.image_.src = this.src_; + } catch (e) { + this.handleImageError_(); + } } };