Remember rendered revision in ol.source.ImageCanvas
This commit is contained in:
@@ -35,6 +35,12 @@ ol.source.ImageCanvas = function(options) {
|
||||
*/
|
||||
this.canvas_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.renderedRevision_ = 0;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
@@ -55,6 +61,7 @@ ol.source.ImageCanvas.prototype.getImage =
|
||||
|
||||
var canvas = this.canvas_;
|
||||
if (!goog.isNull(canvas) &&
|
||||
this.renderedRevision_ == this.getRevision() &&
|
||||
canvas.getResolution() == resolution &&
|
||||
canvas.getPixelRatio() == pixelRatio &&
|
||||
ol.extent.containsExtent(canvas.getExtent(), extent)) {
|
||||
@@ -74,6 +81,7 @@ ol.source.ImageCanvas.prototype.getImage =
|
||||
this.getAttributions(), canvasElement);
|
||||
}
|
||||
this.canvas_ = canvas;
|
||||
this.renderedRevision_ = this.getRevision();
|
||||
|
||||
return canvas;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user