Class: Tile

Tile(sector, level, row, column)

Represents a tile of terrain or imagery. Provides a base class for texture tiles used by tiled image layers and elevation tiles used by elevation models. Applications typically do not interact with this class.

Constructor

new Tile(sector, level, row, column)

Constructs a tile for a specified sector, level, row and column.
Parameters:
Name Type Description
sector Sector The sector represented by this tile.
level Level This tile's level in a tile pyramid.
row Number This tile's row in the specified level in a tile pyramid.
column Number This tile's column in the specified level in a tile pyramid.
Source:
Throws:
If the specified sector or level is null or undefined or the row or column arguments are less than zero.
Type
ArgumentError

Members

(readonly) column :Number

The column in this tile's level in which this tile lies in a tile pyramid.
Type:
  • Number
Source:

extent :BoundingBox

The Cartesian bounding box of this tile.
Type:
Source:

(readonly) level :Number

The level at which this tile lies in a tile pyramid.
Type:
  • Number
Source:

opacity :Number

This tile's opacity.
Type:
  • Number
Default Value:
  • 1
Source:

referencePoint :Vec3

The tile's local origin in model coordinates. Any model coordinate points associates with the tile should be relative to this point.
Type:
Source:

(readonly) row :Number

The row in this tile's level in which this tile lies in a tile pyramid.
Type:
  • Number
Source:

(readonly) sector :Sector

The sector represented by this tile.
Type:
Source:

texelSize :Number

The size in radians of pixels or cells of this tile's associated resource.
Type:
  • Number
Source:

tileHeight :Number

The height in pixels or cells of this tile's associated resource.
Type:
  • Number
Source:

(readonly) tileKey :String

A key that uniquely identifies this tile within a level set.
Type:
  • String
Source:

tileWidth :Number

The width in pixels or cells of this tile's associated resource.
Type:
  • Number
Source:

Methods

(static) computeColumn(delta, longitude) → {Number}

Computes a column number for a tile within a level given the tile's longitude.
Parameters:
Name Type Description
delta Number The level's longitudinal tile delta in degrees.
longitude Number The tile's minimum longitude.
Source:
Returns:
The computed column number.
Type
Number

(static) computeLastColumn(delta, maxLongitude) → {Number}

Computes the last column number for a tile within a level given the tile's maximum longitude.
Parameters:
Name Type Description
delta Number The level's longitudinal tile delta in degrees.
maxLongitude Number The tile's maximum longitude in degrees.
Source:
Returns:
The computed column number.
Type
Number

(static) computeLastRow(delta, maxLatitude) → {Number}

Computes the last row number for a tile within a level given the tile's maximum latitude.
Parameters:
Name Type Description
delta Number The level's latitudinal tile delta in degrees.
maxLatitude Number The tile's maximum latitude in degrees.
Source:
Returns:
The computed row number.
Type
Number

(static) computeRow(delta, latitude) → {Number}

Computes a row number for a tile within a level given the tile's latitude.
Parameters:
Name Type Description
delta Number The level's latitudinal tile delta in degrees.
latitude Number The tile's minimum latitude.
Source:
Returns:
The computed row number.
Type
Number

(static) computeSector(level, row, column) → {Sector}

Computes a sector spanned by a tile with the specified level number, row and column.
Parameters:
Name Type Description
level Level The tile's level number.
row Number The tile's row number.
column Number The tile's column number.
Source:
Throws:
If the specified level is null or undefined or the row or column are less than zero.
Type
ArgumentError
Returns:
The sector spanned by the tile.
Type
Sector

(static) createTilesForLevel(level, tileFactory, result)

Creates all tiles for a specified level number.
Parameters:
Name Type Description
level Level The level to create the tiles for.
tileFactory TileFactory The tile factory to use for creating tiles.
result Array.<Tile> An array in which to return the results.
Source:
Throws:
If any argument is null or undefined.
Type
ArgumentError

distanceTo(vector) → {number}

Computes an approximate distance from this tile to a specified vector.
Parameters:
Name Type Description
vector Vec3 The vector to compute the distance to.
Source:
Throws:
If the specified vector is null or undefined.
Type
ArgumentError
Returns:
The distance between this tile and the vector.
Type
number

(protected) doUpdate(dc)

Updates this tile's frame-dependent properties according to the specified draw context.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Source:

isEqual(that) → {boolean}

Indicates whether this tile is equivalent to a specified tile.
Parameters:
Name Type Description
that Tile The tile to check equivalence with.
Source:
Returns:
true if this tile is equivalent to the specified one, false if they are not equivalent or the specified tile is null or undefined.
Type
boolean

mustSubdivide(dc, detailFactor) → {boolean}

Indicates whether this tile should be subdivided based on the current navigation state and a specified detail factor.
Parameters:
Name Type Description
dc DrawContext The current draw context.
detailFactor Number The detail factor to consider.
Source:
Returns:
true If the tile should be subdivided, otherwise false.
Type
boolean

size() → {Number}

Returns the size of this tile in bytes.
Source:
Returns:
The size of this tile in bytes.
Type
Number

subdivide(level, tileFactory) → {Array.<Tile>}

Returns the four children formed by subdividing this tile.
Parameters:
Name Type Description
level Level The level of the children.
tileFactory TileFactory The tile factory to use to create the children.
Source:
Throws:
If the specified tile factory or level is null or undefined.
Type
ArgumentError
Returns:
An array containing the four child tiles.
Type
Array.<Tile>

subdivideToCache(level, tileFactory, cache) → {Array.<Tile>}

Returns the four children formed by subdividing this tile, drawing those children from a specified cache if they exist there.
Parameters:
Name Type Description
level Level The level of the children.
tileFactory TileFactory The tile factory to use to create the children.
cache MemoryCache A memory cache that may contain pre-existing child tiles. If non-null, the cache is checked for a child collection prior to creating that tile. If one exists in the cache it is returned rather than creating a new collection of children. If a new collection is created, it is added to the cache.
Source:
Throws:
If the specified tile factory or level is null or undefined.
Type
ArgumentError
Returns:
An array containing the four tiles.
Type
Array.<Tile>

update(dc)

Updates this tile's frame-dependent properties as necessary, according to the specified draw context.

The tile's frame-dependent properties, include the extent (bounding volume). These properties are dependent on the tile's sector and the elevation values currently in memory, and change when those dependencies change. Therefore update must be called once per frame before the extent and any other frame-dependent properties are used. update intelligently determines when it is necessary to recompute these properties, and does nothing if the state of all dependencies has not changed since the last call.

Parameters:
Name Type Description
dc DrawContext The current draw context.
Source: