Cesium Utils - v0.0.9
    Preparing search index...

    Class HybridTerrainProvider

    Provides terrain by delegating requests to different terrain providers based on geographic regions and zoom levels. This allows combining multiple terrain sources into a single seamless terrain.

    const tileRanges = new Map<number, TileRange>;
    tileRanges.set(15, { start: { x: 55852, y: 9556 }, end: { x: 55871, y: 9575 } });
    const hybridTerrain = await HybridTerrainProvider.create({
    terrainAreas: [
    {
    provider: 'custom-terrain-url',
    tileRanges,
    }
    ],
    terrainProvider: 'default-terrain-url',
    fallbackProvider: new EllipsoidTerrainProvider(),
    });

    viewer.terrainProvider = hybridTerrain;

    Implements

    • TerrainProvider
    Index

    Constructors

    Properties

    _availability?: TileAvailability
    _fallbackProvider: TerrainProvider
    _ready: boolean = false
    _terrainAreas: TerrainAreaCollection = ...
    _terrainProvider: TerrainProvider
    _tilingScheme: TilingScheme

    Accessors

    • get availability(): undefined | TileAvailability

      Gets an object that can be used to determine availability of terrain from this provider.

      Returns undefined | TileAvailability

    • get credit(): any

      Gets the credit to display when this terrain provider is active. Typically this is used to credit the source of the terrain.

      Returns any

    • get errorEvent(): any

      Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of TileProviderError.

      Returns any

    • get hasVertexNormals(): boolean

      Gets a value indicating whether or not the requested tiles include vertex normals.

      Returns boolean

    • get hasWaterMask(): boolean

      Gets a value indicating whether or not the provider includes a water mask. The water mask indicates which areas of the globe are water rather than land, so they can be rendered as a reflective surface with animated waves.

      Returns boolean

    • get ready(): boolean

      Gets a value indicating whether or not the provider is ready for use, or a promise that resolves when the provider becomes ready.

      Returns boolean

    Methods

    • Gets the maximum geometric error allowed in a tile at a given level.

      Parameters

      • level: number

        The tile level for which to get the maximum geometric error.

      Returns number

      The maximum geometric error.

    • Determines whether data for a tile is available to be loaded. Checks the specified terrain areas first.

      Parameters

      • x: number

        The X coordinate of the tile for which to request geometry.

      • y: number

        The Y coordinate of the tile for which to request geometry.

      • level: number

        The level of the tile for which to request geometry.

      Returns undefined | boolean

      Undefined if not supported by the terrain provider, otherwise true or false.

    • Makes sure we load availability data for a tile

      Parameters

      • x: number

        The X coordinate of the tile for which to request geometry.

      • y: number

        The Y coordinate of the tile for which to request geometry.

      • level: number

        The level of the tile for which to request geometry.

      Returns undefined | Promise<void>

      Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded

    • Requests the terrain for a given tile coordinate.

      Parameters

      • x: number

        The X coordinate of the tile.

      • y: number

        The Y coordinate of the tile.

      • level: number

        The zoom level of the tile.

      • Optionalrequest: Request

        The request.

      Returns undefined | Promise<TerrainData>

      A promise for the requested terrain.