Treat image tiles with a zero dimension as empty

This commit is contained in:
Tom Payne
2013-04-25 15:17:24 +02:00
parent d8a4b19b54
commit c576b2a34e

View File

@@ -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();
};