import { TerrainDataSource } from '@here/harp-terrain-datasource'
new TerrainDataSource(TerrainDataSourceOptions)
concurrentDecoderScriptUrl
: string
URL from which to fetch decoder worker script. See Getting Started Guide on how to setup worker.concurrentDecoderServiceName
: string
Arbitrary string to identify the decoder.fetchTile
: (tileKey: TileKey) → Promise<ArrayBuffer>
Fetches a tile using provided tileKey.tilingScheme
: TilingScheme
Tiling scheme used by the data source. See predefined tiling schemes by harp.gl.getTileMaterial?
: (tile: Tile, decodedTile: DecodedTile) → Promise<THREE.Material>
Constructs material of a tile. Can be used also to fetch texture using the tile key.
Default: ElevationMaterialdecoderOptions?
: PNGDecoderOptionsgetDisplayZoomLevel?
: (level: number) → number
Generates custom zoom level for the data source depending on map's zoom.getCustomObjects?
:(terrainTile: TerrainTile) → Promise | void
Allows you to add custom objects on top of the terrain.
widthSegments?
: number
Amount of width segments of Plane Buffer Geometry which will be created for each tile.
Default: 63heightSegments?
: number
Default: 63
Terrain Datasource comes with three.js material for elevation based styling. You can specify different colors for different altitudes.
import { ElevationMaterial } from '@here/harp-terrain-datasource/src/terrain-tile'
new ElevationMaterial(ElevationMaterialOptions)
colorStreps
: [ColorStep]
Defines how colors specific altitudes of your terrain.texture?
: THREE.TexturetextureIntensity?
: number
Defines how to mix texture color (if present) and elevation based color. Ratio in the [0, 1] range, 1 means only texture color, 0 — only elevation based color.lightVector?
: THREE.Vector3
Direction of the light, used to shade the terrain. Default:new THREE.Vector3(1.0, 0.0, 0.5)
altitude
: number
Altitude where to apply color.color
: THREE.Vector3
Color of the specified altitude. Defined as a vector with RGB components.
See also TypeScript typings in ../src/index.d.ts