new TerrainData()
Terrain data for a single tile. This type describes an
interface and is not intended to be instantiated directly.
Members
-
waterMask :Uint8Array|Image|Canvas
-
The water mask included in this terrain data, if any. A water mask is a rectangular Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.Source: Core/TerrainData.js, line 32
Methods
-
createMesh(tilingScheme, x, y, level) → Promise|TerrainMesh
-
Creates a
TerrainMeshfrom this terrain data.Name Type Description tilingSchemeTilingScheme The tiling scheme to which this tile belongs. xNumber The X coordinate of the tile for which to create the terrain data. yNumber The Y coordinate of the tile for which to create the terrain data. levelNumber The level of the tile for which to create the terrain data. Returns:
A promise for the terrain mesh, or undefined if too many asynchronous mesh creations are already in progress and the operation should be retried later.Source: Core/TerrainData.js, line 77 -
interpolateHeight(rectangle, longitude, latitude) → Number
-
Computes the terrain height at a specified longitude and latitude.
Name Type Description rectangleRectangle The rectangle covered by this terrain data. longitudeNumber The longitude in radians. latitudeNumber The latitude in radians. Returns:
The terrain height at the specified position. If the position is outside the rectangle, this method will extrapolate the height, which is likely to be wildly incorrect for positions far outside the rectangle.Source: Core/TerrainData.js, line 48 -
isChildAvailable(thisX, thisY, childX, childY) → Boolean
-
Determines if a given child tile is available, based on the
TerrainData#childTileMask. The given child tile coordinates are assumed to be one of the four children of this tile. If non-child tile coordinates are given, the availability of the southeast child tile is returned.Name Type Description thisXNumber The tile X coordinate of this (the parent) tile. thisYNumber The tile Y coordinate of this (the parent) tile. childXNumber The tile X coordinate of the child tile to check for availability. childYNumber The tile Y coordinate of the child tile to check for availability. Returns:
True if the child tile is available; otherwise, false.Source: Core/TerrainData.js, line 63 -
upsample(tilingScheme, thisX, thisY, thisLevel, descendantX, descendantY, descendantLevel) → Promise|TerrainData
-
Upsamples this terrain data for use by a descendant tile.
Name Type Description tilingSchemeTilingScheme The tiling scheme of this terrain data. thisXNumber The X coordinate of this tile in the tiling scheme. thisYNumber The Y coordinate of this tile in the tiling scheme. thisLevelNumber The level of this tile in the tiling scheme. descendantXNumber The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. descendantYNumber The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. descendantLevelNumber The level within the tiling scheme of the descendant tile for which we are upsampling. Returns:
A promise for upsampled terrain data for the descendant tile, or undefined if too many asynchronous upsample operations are in progress and the request has been deferred.Source: Core/TerrainData.js, line 94 -
wasCreatedByUpsampling() → Boolean
-
Gets a value indicating whether or not this terrain data was created by upsampling lower resolution terrain data. If this value is false, the data was obtained from some other source, such as by downloading it from a remote server. This method should return true for instances returned from a call to
TerrainData#upsample.Returns:
True if this instance was created by upsampling; otherwise, false.Source: Core/TerrainData.js, line 105
