Implement getKeyParams in ol.source.WMTS

This commit is contained in:
Éric Lemoine
2015-11-12 10:54:45 +01:00
parent 132861e175
commit 0f70a21ba6
+7 -7
View File
@@ -61,8 +61,8 @@ ol.source.WMTS = function(options) {
* @private * @private
* @type {string} * @type {string}
*/ */
this.coordKeyPrefix_ = ''; this.dimensionsKey_ = '';
this.resetCoordKeyPrefix_(); this.resetDimensionsKey_();
/** /**
* @private * @private
@@ -218,8 +218,8 @@ ol.source.WMTS.prototype.getFormat = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
ol.source.WMTS.prototype.getKeyZXY = function(z, x, y) { ol.source.WMTS.prototype.getKeyParams = function() {
return this.coordKeyPrefix_ + goog.base(this, 'getKeyZXY', z, x, y); return this.dimensionsKey_;
}; };
@@ -276,13 +276,13 @@ ol.source.WMTS.prototype.getVersion = function() {
/** /**
* @private * @private
*/ */
ol.source.WMTS.prototype.resetCoordKeyPrefix_ = function() { ol.source.WMTS.prototype.resetDimensionsKey_ = function() {
var i = 0; var i = 0;
var res = []; var res = [];
for (var key in this.dimensions_) { for (var key in this.dimensions_) {
res[i++] = key + '-' + this.dimensions_[key]; res[i++] = key + '-' + this.dimensions_[key];
} }
this.coordKeyPrefix_ = res.join('/'); this.dimensionsKey_ = res.join('/');
}; };
@@ -293,7 +293,7 @@ ol.source.WMTS.prototype.resetCoordKeyPrefix_ = function() {
*/ */
ol.source.WMTS.prototype.updateDimensions = function(dimensions) { ol.source.WMTS.prototype.updateDimensions = function(dimensions) {
goog.object.extend(this.dimensions_, dimensions); goog.object.extend(this.dimensions_, dimensions);
this.resetCoordKeyPrefix_(); this.resetDimensionsKey_();
this.changed(); this.changed();
}; };