Rename source.getKeyParams() to source.getKey()
This commit is contained in:
@@ -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) {
|
ol.source.TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
|
||||||
var /** @type {ol.Tile} */ tile = null;
|
var /** @type {ol.Tile} */ tile = null;
|
||||||
var tileCoordKey = this.getKeyZXY(z, x, y);
|
var tileCoordKey = this.getKeyZXY(z, x, y);
|
||||||
var paramsKey = this.getKeyParams();
|
var paramsKey = this.getKey();
|
||||||
if (!this.tileCache.containsKey(tileCoordKey)) {
|
if (!this.tileCache.containsKey(tileCoordKey)) {
|
||||||
goog.asserts.assert(projection, 'argument projection is truthy');
|
goog.asserts.assert(projection, 'argument projection is truthy');
|
||||||
tile = this.createTile_(z, x, y, pixelRatio, projection, paramsKey);
|
tile = this.createTile_(z, x, y, pixelRatio, projection, paramsKey);
|
||||||
|
|||||||
@@ -144,12 +144,11 @@ ol.source.Tile.prototype.getGutter = function(projection) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the "parameters" key, a string composed of the source's
|
* Return the key to be used for all tiles in the source.
|
||||||
* parameters/dimensions.
|
* @return {string} The key for all tiles.
|
||||||
* @return {string} The parameters key.
|
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
ol.source.Tile.prototype.getKeyParams = function() {
|
ol.source.Tile.prototype.getKey = function() {
|
||||||
return this.key_;
|
return this.key_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ ol.source.TileWMS.prototype.getGutterInternal = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.TileWMS.prototype.getKeyParams = function() {
|
ol.source.TileWMS.prototype.getKey = function() {
|
||||||
return this.paramsKey_;
|
return this.paramsKey_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ ol.source.WMTS.prototype.getFormat = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.WMTS.prototype.getKeyParams = function() {
|
ol.source.WMTS.prototype.getKey = function() {
|
||||||
return this.dimensionsKey_;
|
return this.dimensionsKey_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ describe('ol.source.TileImage', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = createSource();
|
source = createSource();
|
||||||
expect(source.getKeyParams()).to.be('');
|
expect(source.getKey()).to.be('');
|
||||||
source.getTileInternal(0, 0, -1, 1, ol.proj.get('EPSG:3857'));
|
source.getTileInternal(0, 0, -1, 1, ol.proj.get('EPSG:3857'));
|
||||||
expect(source.tileCache.getCount()).to.be(1);
|
expect(source.tileCache.getCount()).to.be(1);
|
||||||
tile = source.tileCache.get(source.getKeyZXY(0, 0, -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() {
|
describe('tile is not loaded', function() {
|
||||||
it('returns a tile with no interim tile', function() {
|
it('returns a tile with no interim tile', function() {
|
||||||
source.getKeyParams = function() {
|
source.getKey = function() {
|
||||||
return 'key0';
|
return 'key0';
|
||||||
};
|
};
|
||||||
var returnedTile = source.getTileInternal(
|
var returnedTile = source.getTileInternal(
|
||||||
@@ -56,7 +56,7 @@ describe('ol.source.TileImage', function() {
|
|||||||
|
|
||||||
describe('tile is loaded', function() {
|
describe('tile is loaded', function() {
|
||||||
it('returns a tile with interim tile', function() {
|
it('returns a tile with interim tile', function() {
|
||||||
source.getKeyParams = function() {
|
source.getKey = function() {
|
||||||
return 'key0';
|
return 'key0';
|
||||||
};
|
};
|
||||||
tile.state = ol.TileState.LOADED;
|
tile.state = ol.TileState.LOADED;
|
||||||
@@ -71,7 +71,7 @@ describe('ol.source.TileImage', function() {
|
|||||||
describe('tile is not loaded but interim tile is', function() {
|
describe('tile is not loaded but interim tile is', function() {
|
||||||
it('returns a tile with interim tile', function() {
|
it('returns a tile with interim tile', function() {
|
||||||
var dynamicParamsKey, returnedTile;
|
var dynamicParamsKey, returnedTile;
|
||||||
source.getKeyParams = function() {
|
source.getKey = function() {
|
||||||
return dynamicParamsKey;
|
return dynamicParamsKey;
|
||||||
};
|
};
|
||||||
dynamicParamsKey = 'key0';
|
dynamicParamsKey = 'key0';
|
||||||
|
|||||||
Reference in New Issue
Block a user