Class: TileJSON


import TileJSON from 'ol/source/TileJSON';

Layer source for tile data in TileJSON format.

new TileJSON(options)

source/TileJSON.js, line 52
Name Type Description

TileJSON options.

Name Type Default Description
attributions module:ol/source/Source~AttributionLike


cacheSize number 2048

Cache size.

crossOrigin null | string

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See for more detail.

jsonp boolean false

Use JSONP with callback to load the TileJSON. Useful when the server does not support CORS..

reprojectionErrorThreshold number 0.5

Maximum allowed reprojection error (in pixels). Higher values can increase reprojection performance, but decrease precision.

tileJSON tileJSON

TileJSON configuration for this source. If not provided, url must be configured.

tileLoadFunction module:ol/Tile~LoadFunction

Optional function to load a tile given a URL. The default is

function(imageTile, src) {
  imageTile.getImage().src = src;
url string

URL to the TileJSON file. If not provided, tileJSON must be configured.

wrapX boolean true

Whether to wrap the world horizontally.

transition number

Duration of the opacity transition for rendering. To disable the opacity transition, pass transition: 0.



source/TileJSON.js, line 128
The tilejson object.