Merge pull request #9254 from petrsloup/tilejson-tilesize
Add tileSize option to ol/source/TileJSON
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user