From 564d4f867f89f66c9fdd803334b351922f8492f1 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Sat, 25 Sep 2021 13:24:39 +0100 Subject: [PATCH] Do not replace color if image not loaded --- src/ol/style/IconImage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ol/style/IconImage.js b/src/ol/style/IconImage.js index 689d252046..b8b7041b1d 100644 --- a/src/ol/style/IconImage.js +++ b/src/ol/style/IconImage.js @@ -219,7 +219,11 @@ class IconImage extends EventTarget { * @private */ replaceColor_(pixelRatio) { - if (!this.color_ || this.canvas_[pixelRatio]) { + if ( + !this.color_ || + this.canvas_[pixelRatio] || + this.imageState_ !== ImageState.LOADED + ) { return; }