Merge pull request #9254 from petrsloup/tilejson-tilesize

Add tileSize option to ol/source/TileJSON
This commit is contained in:
Andreas Hocevar
2019-02-22 11:14:19 +01:00
committed by GitHub

View File

@@ -55,6 +55,8 @@ 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.
* Note: `tileSize` and other non-standard TileJSON properties are currently ignored.
* @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 +92,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 +176,8 @@ class TileJSON extends TileImage {
const tileGrid = createXYZ({
extent: extentFromProjection(sourceProjection),
maxZoom: maxZoom,
minZoom: minZoom
minZoom: minZoom,
tileSize: this.tileSize_
});
this.tileGrid = tileGrid;