Add support for smooth TileWMS dimensions

This commit is contained in:
Bart van den Eijnden
2015-12-07 16:21:11 +01:00
parent ba93698c20
commit 0c3aed0083
3 changed files with 106 additions and 4 deletions

View File

@@ -65,6 +65,13 @@ ol.source.TileWMS = function(opt_options) {
*/
this.params_ = params;
/**
* @private
* @type {string}
*/
this.paramsKey_ = '';
this.resetParamsKey_();
/**
* @private
* @type {boolean}
@@ -178,6 +185,14 @@ ol.source.TileWMS.prototype.getGutter = function() {
};
/**
* @inheritDoc
*/
ol.source.TileWMS.prototype.getKeyParams = function() {
return this.paramsKey_;
};
/**
* @inheritDoc
*/
@@ -305,12 +320,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('/');
};
@@ -375,6 +398,7 @@ ol.source.TileWMS.prototype.tileUrlFunction_ =
ol.source.TileWMS.prototype.updateParams = function(params) {
goog.object.extend(this.params_, params);
this.resetCoordKeyPrefix_();
this.resetParamsKey_();
this.updateV13_();
this.changed();
};