Provides a tiled and multi-leveled view on some dataset. Applications can use the tile set to extract a limited working set from the data, which they can then visualize or otherwise process. The contents of the tiles are not specified by this interface.

A tile set knows the underlying data's bounds and reference, as well as the number of levels and the number of tile rows and columns on each level.

Elevation data must be organized using a quad-tree tile set structure.

Raster tile sets must be organized as quad-tree structures when you use them on a Canvas Map.

For a quad-tree tile set structure the expectation is:

  • Level 0 is the least detailed.
  • Each tile on level N corresponds to a block of 2x2 tiles on level N+1.
  • The tile set bounds on each level is the same.

For other tile set structures the expectation is:

  • Level 0 is the least detailed level.
  • Tiles of detail levels should overlap with tiles of their parent level. If this is not the case such tiles are not painted on the map.

The tile set interface allows:

  • Sparse storage: getImage may also indicate that a tile is not available. In other words, although the tiles on each detail level form a regular grid, not all cells in this grid need to be populated. This allows for the creation of high resolution overlays on lower resolution data.
  • Minimal memory footprints: there is no explicit modeling of the tile hierarchy. Objects that represent tiles need only be instantiated when those tiles are actually requested, and are available for garbage collection as soon as the application stops referencing them.

Hierarchy (view full)

Implements

Constructors

Accessors

  • get bounds(): null | Bounds
  • The Bounds by which the geometry of this Bounded object is bounded or null if the bounds is not defined.

    Returns null | Bounds

  • get levelCount(): number
  • The number of available detail levels. Level 0 is the coarsest level.

    Returns number

Methods

  • Returns the bounds of the tile set at the specified detail level.

    Parameters

    • level: number

      the requested detail level.

    Returns null | Bounds

    the bounds of the raster data at the specified detail level. It returns null if the level does not exist.

    Since

    2023.0

  • Loads a tile from the tileset.

    Parameters

    • tile: TileCoordinate

      the coordinate of the tile

    • onSuccess: ((tile, image) => void)

      the callback function that should be invoked when the tile was successfully loaded The function will receive two arguments, the tile coordinate that was passed to this function and an Image object.

    • onError: ((tile, error?) => void)

      the callback function that should be invoked when the tile could not be loaded The function will receive two arguments, the tile coordinate that was passed to this function and an optional Error object.

        • (tile, error?): void
        • Parameters

          Returns void

    • abortSignal: null | AbortSignal

      an AbortSignal that signals when a tile request is cancelled

    Returns void

  • Returns the pixel density of the raster data at the specified detail level. The pixel density is the number of raster elements per spatial unit , i.e. (tile pixel width) / (tile spatial width) and (tile pixel height) / (tile spatial height area), where the tile spatial dimensions are in the tilesets reference.

    Parameters

    • level: number

      the requested detail level

    Returns null | number[]

    the pixel density of the raster data at the specified detail level. It returns null if the level does not exist.

  • Returns the bounds of a given tile in the tile set. The bounds are calculated based on the model bounds and the model's tileset structure.

    Parameters

    • tile: TileCoordinate

      The tile coordinate for which you want to calculate the bounds

    Returns Bounds

    The bounds of the requested tile coordinate in the model's reference.

    Since

    2020.1

  • Returns the number of columns in the tile grid at the given level. Each level should have twice the number of columns of the previous one.

    Parameters

    • level: number

      the level to be queried

    Returns null | number

    the number of tile columns on the specified level

  • Loads a tile from the tileset. The default implementation of this method calls the getImage method.

    The following code snippet illustrates how this method can be overridden.

    model.getTileData = function(tile, onSuccess, onError) {
    fetch(url).then(function(response) {
    response.arrayBuffer().then(function(arrayBuffer) {
    onSuccess(tile, {
    data: arrayBuffer,
    mimeType: "image/jpeg"
    });
    })
    });

    Parameters

    • tile: TileCoordinate

      the coordinate of the tile

    • onSuccess: ((tile, data) => void)

      the callback function that should be invoked when the tile was successfully loaded The function will receive two arguments, the tile coordinate that was passed to this function and a TileData object.

    • onError: ((tile, error) => void)

      the callback function that should be invoked when the tile could not be loaded The function will receive two arguments, the tile coordinate that was passed to this function and an optional Error object.

        • (tile, error): void
        • Parameters

          Returns void

    • abortSignal: null | AbortSignal

      an AbortSignal that signals when a tile request is cancelled.

    Returns void

  • Returns the height, in pixels, of the tiles at the specified detail level. All tiles are assumed to have the same resolution.

    Parameters

    • level: number

      the requested detail level

    Returns null | number

    the height of the tiles at the specified detail level

  • Returns the number of rows in the tile grid at the given level. Each level should have twice the number of rows of the previous one.

    Parameters

    • level: number

      the level to be queried

    Returns null | number

    the number of tile rows on the specified level

  • Returns the width, in pixels, of the tiles at the specified detail level. All tiles are assumed to have the same resolution.

    Parameters

    • level: number

      the requested detail level

    Returns null | number

    the width of the tiles at the specified detail level

  • Signals that the underlying data for the tiled images has changed. If this model is added to a map using a RasterTileSetLayer, calling this method will thus trigger a refresh of the visualization.

    Returns void

Events

"Invalidated" event

  • on("Invalidated", callback: ((...args) => void), context?: any) : Handle
  • An event indicating that this RasterTileSetModel is invalidated. Invalidated means that the underlying data for the tiled images has changed This event fires when invalidate is called. "Invalidated"

    Parameters

    • event: "Invalidated"
    • callback: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns Handle