Merge pull request #4527 from bartvde/wmstime_new

Add support for smooth TileWMS dimensions
This commit is contained in:
Bart van den Eijnden
2016-01-20 14:14:16 +01:00
3 changed files with 106 additions and 4 deletions

View File

@@ -63,6 +63,13 @@ ol.source.TileWMS = function(opt_options) {
*/
this.params_ = params;
/**
* @private
* @type {string}
*/
this.paramsKey_ = '';
this.resetParamsKey_();
/**
* @private
* @type {boolean}
@@ -175,6 +182,14 @@ ol.source.TileWMS.prototype.getGutter = function() {
};
/**
* @inheritDoc
*/
ol.source.TileWMS.prototype.getKeyParams = function() {
return this.paramsKey_;
};
/**
* @inheritDoc
*/
@@ -290,12 +305,20 @@ ol.source.TileWMS.prototype.resetCoordKeyPrefix_ = function() {
}
}
var key;
for (key in this.params_) {
this.coordKeyPrefix_ = res.join('#');
};
/**
* @private
*/
ol.source.TileWMS.prototype.resetParamsKey_ = function() {
var i = 0;
var res = [];
for (var key in this.params_) {
res[i++] = key + '-' + this.params_[key];
}
this.coordKeyPrefix_ = res.join('#');
this.paramsKey_ = res.join('/');
};
@@ -355,6 +378,7 @@ ol.source.TileWMS.prototype.fixedTileUrlFunction = function(tileCoord, pixelRati
ol.source.TileWMS.prototype.updateParams = function(params) {
goog.object.extend(this.params_, params);
this.resetCoordKeyPrefix_();
this.resetParamsKey_();
this.updateV13_();
this.changed();
};