Rework TileDebug to fix reprojection issue and allow {-y}
Add setImage method to ol/ImageTile
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user