diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index ca3fbcca35..19eb86af7a 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -55,6 +55,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; * imageTile.getImage().src = src; * }; * ``` + * @property {number|import("../size.js").Size} [tileSize=[256, 256]] The tile size used by the tile service. * @property {string} [url] URL to the TileJSON file. If not provided, `tileJSON` must be configured. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. * @property {number} [transition] Duration of the opacity transition for rendering. @@ -90,6 +91,12 @@ class TileJSON extends TileImage { */ this.tileJSON_ = null; + /** + * @type {number|import("../size.js").Size} + * @private + */ + this.tileSize_ = options.tileSize; + if (options.url) { if (options.jsonp) { @@ -168,7 +175,8 @@ class TileJSON extends TileImage { const tileGrid = createXYZ({ extent: extentFromProjection(sourceProjection), maxZoom: maxZoom, - minZoom: minZoom + minZoom: minZoom, + tileSize: this.tileSize_ }); this.tileGrid = tileGrid;