maplibre-terrain-rendering
Installation
SKILL.md
MapLibre Terrain Rendering
A raster-dem source is elevation, not a picture. Four different things draw it, each with its own layer
type or API, and most of the wrong answers here are Mapbox GL JS properties that MapLibre never had.
When to Use This Skill
These are symptoms as you would observe them, before you know the cause:
- Harsh hillshade contrast: black-and-white ridges, blown-out slopes, chalky valleys — or several hillshade layers stacked to soften them (one layer with
hillshade-method: "multidirectional"). - Dynamic elevation coloring: the map needs coloring by height, client-side, with no pre-rendered tiles (a
color-relieflayer over["elevation"], notraster-coloron arasterlayer). - Runtime contour lines: contour lines straight from a
raster-demsource, with no pre-generated contour tileset (maplibre-contour, not a hand-rolled marching-squares pipeline). - Flat 3D terrain:
map.setTerrain()is on and nothing extrudes (the camera is atpitch: 0, and raisingexaggerationwill not fix it). - Blank horizon: pitching the camera shows empty page background above the terrain (no root-level
skyobject ormap.setSky(); there is notype: "sky"layer in MapLibre). - Silent property failures: a hillshade, sky, or terrain-coloring property does nothing and raises no error (a Mapbox GL JS property MapLibre never had).
- Terrain lag or frame drops: stutter when panning or tilting with terrain on (stacked hillshade passes, dense draped layers).