From c576b2a34e07818b64ea2e5ac4af2702e4505d36 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 25 Apr 2013 15:17:24 +0200 Subject: [PATCH] Treat image tiles with a zero dimension as empty --- src/ol/imagetile.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ol/imagetile.js b/src/ol/imagetile.js index 3795df9de7..8b97d630b5 100644 --- a/src/ol/imagetile.js +++ b/src/ol/imagetile.js @@ -104,7 +104,11 @@ ol.ImageTile.prototype.handleImageError_ = function() { * @private */ ol.ImageTile.prototype.handleImageLoad_ = function() { - this.state = ol.TileState.LOADED; + if (this.image_.naturalWidth && this.image_.naturalHeight) { + this.state = ol.TileState.LOADED; + } else { + this.state = ol.TileState.EMPTY; + } this.unlistenImage_(); this.dispatchChangeEvent(); };