From c5dcde445510921c2dcbc6dbc915506b2fa8922c Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 18 May 2016 18:47:38 -0600 Subject: [PATCH] Less special handling for WMS tiles --- src/ol/source/tilewmssource.js | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index 050c66e47c..3d43f097c9 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -63,13 +63,6 @@ ol.source.TileWMS = function(opt_options) { */ this.params_ = params; - /** - * @private - * @type {string} - */ - this.paramsKey_ = ''; - this.resetParamsKey_(); - /** * @private * @type {boolean} @@ -103,6 +96,7 @@ ol.source.TileWMS = function(opt_options) { this.tmpExtent_ = ol.extent.createEmpty(); this.updateV13_(); + this.setKey(this.getKeyForParams_()); }; goog.inherits(ol.source.TileWMS, ol.source.TileImage); @@ -182,14 +176,6 @@ ol.source.TileWMS.prototype.getGutterInternal = function() { }; -/** - * @inheritDoc - */ -ol.source.TileWMS.prototype.getKey = function() { - return this.paramsKey_; -}; - - /** * @inheritDoc */ @@ -311,14 +297,15 @@ ol.source.TileWMS.prototype.resetCoordKeyPrefix_ = function() { /** * @private + * @return {string} The key for the current params. */ -ol.source.TileWMS.prototype.resetParamsKey_ = function() { +ol.source.TileWMS.prototype.getKeyForParams_ = function() { var i = 0; var res = []; for (var key in this.params_) { res[i++] = key + '-' + this.params_[key]; } - this.paramsKey_ = res.join('/'); + return res.join('/'); }; @@ -378,9 +365,8 @@ ol.source.TileWMS.prototype.fixedTileUrlFunction = function(tileCoord, pixelRati ol.source.TileWMS.prototype.updateParams = function(params) { ol.object.assign(this.params_, params); this.resetCoordKeyPrefix_(); - this.resetParamsKey_(); this.updateV13_(); - this.changed(); + this.setKey(this.getKeyForParams_()); };