Remember rendered revision in ol.source.ImageWMS

This commit is contained in:
Tom Payne
2014-01-16 18:27:45 +01:00
parent eb3c8a8bfc
commit 27ad19a613

View File

@@ -74,6 +74,12 @@ ol.source.ImageWMS = function(opt_options) {
*/
this.image_ = null;
/**
* @private
* @type {number}
*/
this.renderedRevision_ = 0;
/**
* @private
* @type {number}
@@ -112,6 +118,7 @@ ol.source.ImageWMS.prototype.getImage =
var image = this.image_;
if (!goog.isNull(image) &&
this.renderedRevision_ == this.getRevision() &&
image.getResolution() == resolution &&
image.getPixelRatio() == pixelRatio &&
ol.extent.containsExtent(image.getExtent(), extent)) {
@@ -190,6 +197,7 @@ ol.source.ImageWMS.prototype.getImage =
this.image_ = new ol.Image(extent, resolution, pixelRatio,
this.getAttributions(), url, this.crossOrigin_);
this.renderedRevision_ = this.getRevision();
return this.image_;
};