Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TerrainTileLayerStyle

Configuration style for a 3D terrain tile layer.

This class controls the visual appearance of terrain tiles, including vertical exaggeration, lighting, material properties, and sky background color. It extends the regular processed layer style so it can be used directly as both the style definition and style manager.

It can be passed to the style field of TerrainTileLayerOptions.

Hierarchy

  • RuntimeLayerStyle
    • TerrainTileLayerStyle

Implements

Index

Constructors

Methods

Constructors

constructor

  • new TerrainTileLayerStyle(style?: { backgroundColor?: LayerStyle["backgroundColor"]; colorSource?: { type: "material" } | { color: Color; type: "solid" } | { layerId: string; type: "layerBackground" }; exaggeration?: number; light?: (AmbientLight | DirectionalLight)[]; material?: Material; skyColor?: LayerStyle["skyColor"] }): TerrainTileLayerStyle
  • Creates a new instance of TerrainTileLayerStyle.

    Parameters

    • Default value style: { backgroundColor?: LayerStyle["backgroundColor"]; colorSource?: { type: "material" } | { color: Color; type: "solid" } | { layerId: string; type: "layerBackground" }; exaggeration?: number; light?: (AmbientLight | DirectionalLight)[]; material?: Material; skyColor?: LayerStyle["skyColor"] } = {}

      Optional configuration object for terrain style parameters.

      • Optional backgroundColor?: LayerStyle["backgroundColor"]

        Defines the background color of the terrain layer, shown when terrain data is not fully loaded.

      • Optional colorSource?: { type: "material" } | { color: Color; type: "solid" } | { layerId: string; type: "layerBackground" }

        Controls how the terrain surface is colored.

        The color source defines the base color (albedo) of the terrain mesh before lighting is applied.

        This property is independent of backgroundColor, which is only used when terrain data is missing or not yet rendered.

        Available modes

        • { type: 'material' } Uses the diffuse color defined by the terrain material. This is the default behavior.

        • { type: 'solid', color } Uses a single, solid color for the entire terrain surface. Lighting is still applied, but the base color is constant.

        • { type: 'layerBackground', layerId } Uses the background color of another layer as the terrain surface color. Typically used when visual data from another layer is rendered offscreen and projected onto the terrain.

          If the referenced layer is not available or not yet rendered, its backgroundColor is used as a fallback.

        defaultvalue

        { type: 'material' }

      • Optional exaggeration?: number

        Elevation scale multiplier applied during rendering. This visually scales the terrain heights (e.g. 1 = real scale, 2 = double vertical exaggeration).

        Also known as "vertical exaggeration". Has no effect on the actual height data.

        defaultvalue

        1

      • Optional light?: (AmbientLight | DirectionalLight)[]

        Lights to illuminate the terrain surface.

        Can include ambient and directional lights to control shading effects. If omitted, a default terrain light setup is used, which is just a simple ambient light (no directional lights).

      • Optional material?: Material

        Material properties applied to the terrain mesh.

        This defines visual attributes such as color, shading, or roughness, depending on the renderer's material model.

      • Optional skyColor?: LayerStyle["skyColor"]

        Defines the sky color of the map LayerStyle.skyColor

    Returns TerrainTileLayerStyle

Methods

setMaterial

  • setMaterial(materialUpdate: Partial<Pick<Material, "specular" | "shininess">>): void
  • Updates the terrain material values that can be changed without rebuilding terrain buffers.

    Parameters

    • materialUpdate: Partial<Pick<Material, "specular" | "shininess">>

      The live specular color and/or shininess values.

      Call display.refresh() after changing the material to render the new values.

    Returns void

Generated using TypeDoc