GeoLeaf Core API - v3.19.0
    Preparing search index...

    Function activateTerrain

    • Activates 3D terrain rendering for a given basemap config — the terrain of the "basemap" activation mode, put on by the selection of its basemap.

      • Makes terrain-dem the raster-dem source the config asks for: kept when the one in place is the very same, replaced when it reads another elevation.
      • Calls map.setTerrain() with the configured source and exaggeration.
      • Posts the configured pitch and bearing at once, via map.jumpTo().
      • Listens to style.load: a terrain the engine dropped with a style it rebuilt is put back, the camera left where it is.

      When a layer still reads a terrain-dem source of another elevation, the engine refuses to let it go: a warning is logged, and neither the terrain nor the camera is touched.

      Parameters

      • map: NativeMap | null

        The native maplibregl.Map instance.

      • config: TerrainConfig

        The terrain configuration from the basemap definition.

      • basemapKey: string

        The key of the basemap this terrain config belongs to.

      Returns void