Options
All
  • Public
  • Public/Protected
  • All
Menu

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 but 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

Implements

Overview

Constructors

constructor

Events

on

  • (event: "Invalidated", callback: (...args: any[]) => 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.

    Parameters

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

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns Handle

Accessors

bounds

coordinateType

dataType

  • Returns the data type of this RasterTileSetModel.

    Returns RasterDataType

levelCount

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

    Returns number

modelDescriptor

reference

samplingMode

Methods

getBounds

  • (level: number): Bounds | null
  • Returns the bounds of the tile set at the specified detail level.

    since

    2023.0

    Parameters

    • level: number

      the requested detail level.

    Returns Bounds | null

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

Abstract getImage

  • Loads a tile from the tileset.

    Parameters

    • tile: TileCoordinate

      the coordinate of the tile

    • onSuccess: (tile: TileCoordinate, image: HTMLImageElement) => 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: TileCoordinate, error?: any) => 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.

    • abortSignal: AbortSignal | null

      an AbortSignal that signals when a tile request is cancelled

    Returns void

getPixelDensity

  • (level: number): number[] | null
  • 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 number[] | null

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

getTileBounds

  • 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.

    since

    2020.1

    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.

getTileColumnCount

  • (level: number): number | null
  • 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 number | null

    the number of tile columns on the specified level

getTileData

  • 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: TileCoordinate, data: TileData) => 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: TileCoordinate, error: any) => 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.

    • abortSignal: AbortSignal | null

      an AbortSignal that signals when a tile request is cancelled.

    Returns void

getTileHeight

  • (level: number): number | null
  • 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 number | null

    the height of the tiles at the specified detail level

getTileRowCount

  • (level: number): number | null
  • 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 number | null

    the number of tile rows on the specified level

getTileWidth

  • (level: number): number | null
  • 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 number | null

    the width of the tiles at the specified detail level

invalidate

  • (): void
  • 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

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method