Rename source.getKeyParams() to source.getKey()

This commit is contained in:
Tim Schaub
2016-05-18 18:34:50 -06:00
parent 81d5849207
commit 841c8a5747
5 changed files with 10 additions and 11 deletions

View File

@@ -279,7 +279,7 @@ ol.source.TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection
ol.source.TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
var /** @type {ol.Tile} */ tile = null;
var tileCoordKey = this.getKeyZXY(z, x, y);
var paramsKey = this.getKeyParams();
var paramsKey = this.getKey();
if (!this.tileCache.containsKey(tileCoordKey)) {
goog.asserts.assert(projection, 'argument projection is truthy');
tile = this.createTile_(z, x, y, pixelRatio, projection, paramsKey);

View File

@@ -144,12 +144,11 @@ ol.source.Tile.prototype.getGutter = function(projection) {
/**
* Return the "parameters" key, a string composed of the source's
* parameters/dimensions.
* @return {string} The parameters key.
* Return the key to be used for all tiles in the source.
* @return {string} The key for all tiles.
* @protected
*/
ol.source.Tile.prototype.getKeyParams = function() {
ol.source.Tile.prototype.getKey = function() {
return this.key_;
};

View File

@@ -185,7 +185,7 @@ ol.source.TileWMS.prototype.getGutterInternal = function() {
/**
* @inheritDoc
*/
ol.source.TileWMS.prototype.getKeyParams = function() {
ol.source.TileWMS.prototype.getKey = function() {
return this.paramsKey_;
};

View File

@@ -216,7 +216,7 @@ ol.source.WMTS.prototype.getFormat = function() {
/**
* @inheritDoc
*/
ol.source.WMTS.prototype.getKeyParams = function() {
ol.source.WMTS.prototype.getKey = function() {
return this.dimensionsKey_;
};

View File

@@ -27,7 +27,7 @@ describe('ol.source.TileImage', function() {
beforeEach(function() {
source = createSource();
expect(source.getKeyParams()).to.be('');
expect(source.getKey()).to.be('');
source.getTileInternal(0, 0, -1, 1, ol.proj.get('EPSG:3857'));
expect(source.tileCache.getCount()).to.be(1);
tile = source.tileCache.get(source.getKeyZXY(0, 0, -1));
@@ -43,7 +43,7 @@ describe('ol.source.TileImage', function() {
describe('tile is not loaded', function() {
it('returns a tile with no interim tile', function() {
source.getKeyParams = function() {
source.getKey = function() {
return 'key0';
};
var returnedTile = source.getTileInternal(
@@ -56,7 +56,7 @@ describe('ol.source.TileImage', function() {
describe('tile is loaded', function() {
it('returns a tile with interim tile', function() {
source.getKeyParams = function() {
source.getKey = function() {
return 'key0';
};
tile.state = ol.TileState.LOADED;
@@ -71,7 +71,7 @@ describe('ol.source.TileImage', function() {
describe('tile is not loaded but interim tile is', function() {
it('returns a tile with interim tile', function() {
var dynamicParamsKey, returnedTile;
source.getKeyParams = function() {
source.getKey = function() {
return dynamicParamsKey;
};
dynamicParamsKey = 'key0';