Skip to main content

3D Terrain

3D Terrain is a full-fledged three-dimensional space model (unlike Hillshade). In this mode, the Earth surface has the most realistic geometry and appearance.

introduction



Enabling and disabling

By default, 3D Terrain is disabled. To enable it, change the terrainEnabled global style variable using the map.patchStyleState() method:

// Enable 3D-terrain
map.patchStyleState({ terrainEnabled: true });

// Disable 3D-terrain
map.patchStyleState({ terrainEnabled: false });


3D Terrain settings

3D Terrain is customized using the Style editor. Enable the 3D Terrain mode with the corresponding switch in the Settings section.

styleeditor

The 3D Terrain display parameters are configured in the left panel with layers, on the Other tab. Parameter and their example values are described below.

Vertical scale

Adjusts the clarity degree of terrain. A correctly adjusted vertical scale allows you to display the landscape better, like in the example below:

Comparison of different vertical scale values

Lighting direction

The direction from which the terrain is illuminated by a light source. Recommended value in cartography is 315°. Human eyes are accustomed to perceiving maps at this exact angle of illumination, so changing it may distort perception of the terrain (for example, mountains can be considered cavities). Compare different directions of illumination in the example below:

Comparison of different lighting directions

Shading intensity

Adjusts the contrast of slope shading and illumination.

Comparison of different shading intensity values

Shading palette

This palette allows you to change the character of the terrain shading/lightening, which can be useful for additional styling of its appearance.

palette

Using with Hillshade

You can use 3D terrain in combination with Hillshade vector layers:

  1. In the terran settings, disable the built-in slope shading mechanism by setting the Shading intensity parameter to 0.
  2. Add the Hillshade light and Hillshade dark layers to the map.

Hillshade vector layers give sharper outlines of mountains, but they cannot be displayed if the zoom parameter value is higher than 14. Recommended solution: use vector Hillshade layers for zoom values lower than 14 and use the Hillshade built into the terrain for other zoom values.

To establish three-dimensional terrain display on all zoom levels, you can configure smooth connection of the built-in Hillshade when the zoom value is 13 or higher using an interpolate expression:

Specifying intensity with an interpolate expression