diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 55150e89fe..b4f5a1db6a 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -83,7 +83,8 @@ class TileImage extends UrlTile { url: options.url, urls: options.urls, wrapX: options.wrapX, - transition: options.transition + transition: options.transition, + opt_key: options.opt_key, }); /** diff --git a/src/ol/source/UrlTile.js b/src/ol/source/UrlTile.js index fb6e625a70..1f1dd5a84f 100644 --- a/src/ol/source/UrlTile.js +++ b/src/ol/source/UrlTile.js @@ -64,6 +64,7 @@ class UrlTile extends TileSource { */ this.tileUrlFunction = this.fixedTileUrlFunction ? this.fixedTileUrlFunction.bind(this) : nullTileUrlFunction; + this.key_ = options.opt_key || this.key_; /** * @protected @@ -77,7 +78,7 @@ class UrlTile extends TileSource { this.setUrl(options.url); } if (options.tileUrlFunction) { - this.setTileUrlFunction(options.tileUrlFunction); + this.setTileUrlFunction(options.tileUrlFunction, options.opt_key); } /**