new TerrainData()
Terrain data for a single tile.
Members
-
creditsArray.<Credit>
-
The copyright statement for this tile.
-
waterMaskUint8Array Image Canvas
-
The water mask data included in the terrain data (if any). The water mask is a rectangular Uint8Array or image, where the value of 255 represents the water area and the value of 0 represents the land. It is also allowed to use values between 0 and 255 to smoothly mix land and water.
Methods
-
interpolateHeight(rectangle, longitude, latitude){Number}
-
Calculate the terrain height at the specified latitude and longitude.
Name Type Description rectangleRectangle The rectangular area covered by the terrain data.
longitudeNumber Longitude, measured in radians.
latitudeNumber Latitude, measured in radians.
Returns:
Type Description Number The terrain height at the specified location. If the position is not within the rectangular range, this method will calculate the height. For positions far outside the rectangle, the estimated height is likely to vary greatly. -
isChildAvailable(thisX, thisY, childX, childY){Boolean}
-
Determine whether the given child tile is available based on TerrainData # childTileMask. Assuming the given sub tile coordinates are one of the four sub tiles of this tile. If non sub tile coordinates are given, return the availability of the southeast sub tile.
Name Type Description thisXNumber The X coordinate of the tile (parent tile).
thisYNumber The Y coordinate of the tile (parent tile).
childXNumber Check the X coordinate of the available sub tiles.
childYNumber Check the Y coordinate of the available sub tiles.
Returns:
Type Description Boolean If sub tiles are available, then true; Otherwise, it is false. -
upsample(tilingScheme, thisX, thisY, thisLevel, descendantX, descendantY, descendantLevel){Promise.<TerrainData>|undefined}
-
High sampling of terrain data for use by sub tiles.
Name Type Description tilingSchemeTilingScheme The slicing scheme for the terrain data.
thisXNumber The X-coordinate of the tile in the slicing scheme.
thisYNumber The Y coordinate of the tile in the slicing scheme.
thisLevelNumber The level of the tile in the slicing scheme.
descendantXNumber We need to perform high sampling on the X-coordinate of the sub tiles in the slicing scheme.
descendantYNumber We need to perform high sampling on the Y coordinate of the sub tiles in the slicing scheme.
descendantLevelNumber We need to perform high sampling on the level of sub tiles in the slicing scheme.
Returns:
Type Description Promise.<TerrainData> | undefined Promise to provide high sampling terrain data for sub tiles, undefined if too many asynchronous loading operations are in progress and requests are delayed. -
wasCreatedByUpsampling(){Boolean}
-
Get a value indicating whether this terrain data was created from high sampling low resolution terrain data. If this value is false, then the data was obtained from another source, such as downloading from a remote server. For the instance returned by calling TerrainData # upsample, this method should return true.
Returns:
Type Description Boolean If the instance was created through high sampling, it is true; Otherwise, it is false.