Class: ImageUrlSource

ImageUrlSource(sourceFromTile, opts)

Source that loads images given a URL and a crop rectangle.

Constructor

new ImageUrlSource(sourceFromTile, opts)

Parameters:
Name Type Description
sourceFromTile function

Function that receives a tile and returns an object { url, rect }.

opts Object
Properties
Name Type Attributes Default Description
concurrency number <optional>
4

Maximum number of tiles to load at the same time.

retryDelay number <optional>
10000

Milliseconds to wait before retrying failed requests.

Implements:

Methods

(static) fromString(url, opts)

Create an ImageUrlSource from a string template

Parameters:
Name Type Description
url String

Template for the tile URLs. The following placeholders may be used:

  • {z} : tile level index (0 is the smallest level)
  • {f} : tile face (b, d, f, l, r, u)
  • {x} : tile x index
  • {y} : tile y index
opts Object
Properties
Name Type Attributes Default Description
cubeMapPreviewUrl String

Use the cube map preview at this URL as the first level

cubeMapPreviewFaceOrder String <optional>
'bdflru'

Ordering of the faces on the cube map preview

loadAsset(stage, tile, done) → {function}

Loads an asset from the source.

Parameters:
Name Type Description
stage Stage
tile Tile
done function

Callback.

Implements:
Returns:

Function that cancels the loading when called.

Type
function