Catch CORS exceptions when loading icons

This commit is contained in:
Tom Payne
2014-03-01 13:56:23 +01:00
parent fe0a32c4db
commit fb1c66525c

View File

@@ -429,7 +429,11 @@ ol.style.IconImage_.prototype.load = function() {
goog.events.listenOnce(this.image_, goog.events.EventType.LOAD,
this.handleImageLoad_, false, this)
];
try {
this.image_.src = this.src_;
} catch (e) {
this.handleImageError_();
}
}
};