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 or missing haze: pitching the camera shows empty page background above the terrain, or Mapbox's
map.setFogis not a function after migrating (no root-levelskyobject ormap.setSky(); there is notype: "sky"layer in MapLibre). - Unknown-property errors: a hillshade, sky, or terrain-coloring property makes the console log
unknown property; the call that set it changes nothing, and a style that holds it does not load (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).