For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Class TerrainTileManager

This class is a helper for the Terrain-class, it:

  • loads raster-dem tiles
  • manages all renderToTexture tiles.
  • caches previous rendered tiles.
  • finds all necessary renderToTexture tiles for a OverscaledTileID area
  • finds the corresponding raster-dem tile for OverscaledTileID

Hierarchy (View Summary)

Index

Constructors

Properties

deltaZoom: number

raster-dem tiles will load for performance the actualZoom - deltaZoom zoom-level.

maxzoom: number

maximum zoomlevel to render the terrain.

minzoom: number

minimum zoomlevel to render the terrain.

tileManager: TileManager

tile manager for the raster-dem source.

tileSize: number

render-to-texture tileSize in scene.

Methods

  • gets whether any tiles were loaded after a specific time. This is used to update the depth framebuffer.

    Parameters

    • Optionaltime: number

      the time

    Returns boolean

    true if any tiles came into view at or after the specified time

  • Returns void

  • Parameters

    • key: string

    Returns Tile | undefined

  • get a list of tiles, which are loaded and should be rendered in the current scene

    Returns Tile[]

    the renderable tiles

  • find the covering raster-dem tile

    Parameters

    • tileID: OverscaledTileID

      the tile to look for

    • OptionalsearchForDEM: boolean

      Optional parameter to search for (parent) source tiles with loaded dem.

    Returns Tile | undefined

    the tile

  • get terrain tile by the TileID key

    Parameters

    • id: string

      the tile id

    Returns Tile

    the tile

  • Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.

    Parameters

    • type: string

      The event type

    Returns boolean

    true if there is at least one registered listener for specified event type, false otherwise

  • Removes a previously registered event listener.

    Type Parameters

    • T extends string

    Parameters

    • type: T

      The event type to remove listeners for.

    • listener: (event: Event<string>) => void

      The listener function to remove.

    Returns this

  • Adds a listener to a specified event type.

    Type Parameters

    • T extends string

    Parameters

    • type: T

      The event type to add a listen for.

    • listener: (event: Event<string>) => void

      The function to be called when the event is fired. The listener function is called with the data object passed to fire, extended with target and type properties.

    Returns Subscription

  • Adds a listener that will be called only once to a specified event type.

    The listener will be called first time the event fires after the listener is registered.

    Type Parameters

    • T extends string

    Parameters

    • type: T

      The event type to listen for.

    Returns Promise<Event<string>>

    a promise that resolves with the event

  • Adds a listener that will be called only once to a specified event type.

    The listener will be called first time the event fires after the listener is registered.

    Type Parameters

    • T extends string

    Parameters

    • type: T

      The event type to listen for.

    • listener: (event: Event<string>) => void

      The function to be called when the event is fired the first time.

    Returns this

    this when a listener is provided

  • Release the A RTT objects for all tiles.

    Returns void

  • Load Terrain Tiles, create internal render-to-texture tiles, free GPU memory.

    Parameters

    Returns boolean

    true when the set of renderable tiles changed

Was this helpful?