Less special handling for WMTS tiles
This commit is contained in:
@@ -54,13 +54,6 @@ ol.source.WMTS = function(options) {
|
||||
*/
|
||||
this.dimensions_ = options.dimensions !== undefined ? options.dimensions : {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string}
|
||||
*/
|
||||
this.dimensionsKey_ = '';
|
||||
this.resetDimensionsKey_();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string}
|
||||
@@ -187,6 +180,8 @@ ol.source.WMTS = function(options) {
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : false
|
||||
});
|
||||
|
||||
this.setKey(this.getKeyForDimensions_());
|
||||
|
||||
};
|
||||
goog.inherits(ol.source.WMTS, ol.source.TileImage);
|
||||
|
||||
@@ -213,14 +208,6 @@ ol.source.WMTS.prototype.getFormat = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.WMTS.prototype.getKey = function() {
|
||||
return this.dimensionsKey_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Return the layer of the WMTS source.
|
||||
* @return {string} Layer.
|
||||
@@ -273,14 +260,15 @@ ol.source.WMTS.prototype.getVersion = function() {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @return {string} The key for the current dimensions.
|
||||
*/
|
||||
ol.source.WMTS.prototype.resetDimensionsKey_ = function() {
|
||||
ol.source.WMTS.prototype.getKeyForDimensions_ = function() {
|
||||
var i = 0;
|
||||
var res = [];
|
||||
for (var key in this.dimensions_) {
|
||||
res[i++] = key + '-' + this.dimensions_[key];
|
||||
}
|
||||
this.dimensionsKey_ = res.join('/');
|
||||
return res.join('/');
|
||||
};
|
||||
|
||||
|
||||
@@ -291,8 +279,7 @@ ol.source.WMTS.prototype.resetDimensionsKey_ = function() {
|
||||
*/
|
||||
ol.source.WMTS.prototype.updateDimensions = function(dimensions) {
|
||||
ol.object.assign(this.dimensions_, dimensions);
|
||||
this.resetDimensionsKey_();
|
||||
this.changed();
|
||||
this.setKey(this.getKeyForDimensions_());
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user