Class: TileJSON

ol/source/TileJSON~TileJSON


import TileJSON from 'ol/source/TileJSON';

Layer source for tile data in TileJSON format.

new TileJSON(options)

source/TileJSON.js, line 71
Name Type Description
options

TileJSON options.

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

Attributions.

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 https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image 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 module:ol/source/TileJSON~Config

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.

Fires:

Extends

Methods

getTileJSON(){module:ol/source/TileJSON~Config}

source/TileJSON.js, line 147
Returns:
The tilejson object.

getTileLoadFunction(){module:ol/Tile~LoadFunction} inherited

source/UrlTile.js, line 104

Return the tile load function of the source.

Returns:
TileLoadFunction

getTileUrlFunction(){module:ol/Tile~UrlFunction} inherited

source/UrlTile.js, line 113

Return the tile URL function of the source.

Returns:
TileUrlFunction

getUrls(){!Array.<string>|null} inherited

source/UrlTile.js, line 124

Return the URLs used for this source. When a tileUrlFunction is used instead of url or urls, null will be returned.

Returns:
URLs.

setRenderReprojectionEdges(render) inherited

source/TileImage.js, line 356

Sets whether to render reprojection edges or not (usually for debugging).

Name Type Description
render boolean

Render the edges.

setTileGridForProjection(projection, tilegrid) inherited

source/TileImage.js, line 380

Sets the tile grid to use when reprojecting the tiles to the given projection instead of the default tile grid for the projection.

This can be useful when the default tile grid cannot be created (e.g. projection has no extent defined) or for optimization reasons (custom tile size, resolutions, ...).

Name Type Description
projection module:ol/proj~ProjectionLike

Projection.

tilegrid module:ol/tilegrid/TileGrid~TileGrid

Tile grid to use for the projection.

setTileLoadFunction(tileLoadFunction) inherited

source/UrlTile.js, line 157

Set the tile load function of the source.

Name Type Description
tileLoadFunction module:ol/Tile~LoadFunction

Tile load function.

setTileUrlFunction(tileUrlFunction, key) inherited

source/UrlTile.js, line 169

Set the tile URL function of the source.

Name Type Description
tileUrlFunction module:ol/Tile~UrlFunction

Tile URL function.

key string

Optional new tile key for the source.

setUrl(url) inherited

source/UrlTile.js, line 184

Set the URL to use for requests.

Name Type Description
url string

URL.

setUrls(urls) inherited

source/UrlTile.js, line 194

Set the URLs to use for requests.

Name Type Description
urls Array.<string>

URLs.