This is the documentation of version 0.61.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias TerrainModuleConfig

    TerrainModuleConfig: MapModuleCommonConfig & {
        elevation?: boolean;
        elevationExaggeration?: number;
        hillshade?: boolean;
    }

    Configuration of the TerrainModule: the two ways it draws the relief of the style's elevation data.

    Type Declaration

    • Optionalelevation?: boolean

      Raises the map surface to the elevation data in 3D, or flattens it. Shows best with a pitched camera.

      The map's own terrain, if its style or MapLibre code raised one; none on TomTom styles.
      
    • OptionalelevationExaggeration?: number

      Vertical scaling of the 3D surface: 1 is true elevation, higher values emphasise the relief. Kept while elevation is off, so turning it back on restores it.

      The hillshade.exaggeration knob of StylingModule is a different thing: how strongly the slopes are shaded, raising nothing.

      1
      
    • Optionalhillshade?: boolean

      Shows the hillshade: light and shadow on the map surface that reveal hills, valleys and mountains, at any camera pitch. Its look is set by the hillshade.* knobs of StylingModule.

      false
      

    Unset, the hillshade is hidden like the other style parts the SDK adds (traffic flow and incidents), and the surface is left as the map draws it: flat on TomTom styles. So resetConfig() returns a TomTom style to flat and unshaded.

    const config: TerrainModuleConfig = { hillshade: true, elevation: true, elevationExaggeration: 1.5 };