diff --git a/src/ol/ImageTile.js b/src/ol/ImageTile.js index d636ef73c4..9efc2ccb74 100644 --- a/src/ol/ImageTile.js +++ b/src/ol/ImageTile.js @@ -39,6 +39,8 @@ class ImageTile extends Tile { */ this.src_ = src; + this.key = src; + /** * @private * @type {HTMLImageElement|HTMLCanvasElement} @@ -70,13 +72,6 @@ class ImageTile extends Tile { return this.image_; } - /** - * @return {string} Key. - */ - getKey() { - return this.src_; - } - /** * Tracks loading or read errors. * diff --git a/src/ol/VectorTile.js b/src/ol/VectorTile.js index fb2e63605f..8f7b359aa8 100644 --- a/src/ol/VectorTile.js +++ b/src/ol/VectorTile.js @@ -63,6 +63,8 @@ class VectorTile extends Tile { * @type {string} */ this.url_ = src; + + this.key = src; } /** @@ -83,13 +85,6 @@ class VectorTile extends Tile { return this.features_; } - /** - * @return {string} Key. - */ - getKey() { - return this.url_; - } - /** * Load not yet loaded URI. */ diff --git a/test/spec/ol/source/vectortile.test.js b/test/spec/ol/source/vectortile.test.js index 5419d98658..b849d35c54 100644 --- a/test/spec/ol/source/vectortile.test.js +++ b/test/spec/ol/source/vectortile.test.js @@ -393,7 +393,7 @@ describe('ol.source.VectorTile', function () { ); if (sourceTiles) { expect(sourceTiles[0].getKey()).to.be( - 'spec/ol/data/14-8938-5680.vector.pbf?new' + 'spec/ol/data/14-8938-5680.vector.pbf?new/14,8938,5680' ); unByKey(key); done();