What it does
Two related settings: pitch, which tilts the camera away from straight down, and terrain, which draws relief from elevation data.
Tilting alone changes how a map reads. A city at 60° shows its skyline and street canyons. A valley looks like a valley. Terrain changes the surface itself, so relief becomes visible.
Pitch presets (0°, 30°, 60°) give quick choices, with 0° returning to a flat plan view.
Not every map engine supports both settings. Unsupported buttons are not shown.
Using it
- Pick a pitch, or drag with the right mouse button. On a phone or tablet, use two fingers for any angle in between.
- Turn terrain on where the map has elevation data.
- Return to 0° to get the plan view back.
A tilted map is worse for measuring and comparing. Everything far away is smaller. Tilt for reading the landscape, and flatten again for reading the data.
In your own map
Add 3d to a toolbar. Terrain uses a raster-dem source already on the map. You can configure a fallback where a map has none:
maplibre-terrain-fallback-urlcesium-terrain-fallback-url
The terrain outlives the panel. Closing the tool does not switch terrain off. Closing is how you get the map to yourself, and taking the relief away at that moment removes the relief you closed the panel to see.
Extending it
setTerrainEnabled writes to the store only after the engine reports that terrain changed. A config or permalink can request terrain through the same store field.
Config type | 3d |
|---|---|
| Element | <webmapx-3d-tool> |
| Placement | toolbar |
| Source | src/components/webmapx-3d-tool.ts |
| Tests | tests/tool-registration.test.ts |
| Related | projection, measure, layerLegend3d |