Rework TileDebug to fix reprojection issue and allow {-y}

Add setImage method to ol/ImageTile
This commit is contained in:
mike-000
2021-05-30 19:06:36 +01:00
parent 1e9b0bc079
commit ee5553debb
2 changed files with 40 additions and 106 deletions

View File

@@ -72,6 +72,22 @@ class ImageTile extends Tile {
return this.image_;
}
/**
* Sets an HTML image element for this tile (may be a Canvas or preloaded Image).
* @param {HTMLCanvasElement|HTMLImageElement} element Element.
* @api
*/
setImage(element) {
// asynchronous to accomodate reprojection listeners
const tile = this;
setTimeout(function () {
tile.image_ = element;
tile.state = TileState.LOADED;
tile.unlistenImage_();
tile.changed();
}, 0);
}
/**
* Tracks loading or read errors.
*