mapbox / mapbox/mapbox-gl-js

"raster-dem" source doesn't work with custom dem tiles.

Open
#11,870 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: v2.8.2

**browser**: Any

### Steps to Trigger Behavior

1. I am trying to use my own 1 meter high resolution RGB tiles to setTerrain, rather than using mapbox://mapbox.mapbox-terrain-dem-v1, for a small area.
2. The code is:
` map.addSource("rwanda-dem", {
"type": "raster-dem",
"tiles":
["/public/images/raster-dem/{z}/{x}/{y}.webp"],
"tileSize": 514,
"maxzoom": 18,
"minzoom": 1,
});`
3. The area's terrain was generated correctly with elevation, excep the whole area is floating from other part of the map where no elevation covered.

![area](https://user-images.githubusercontent.com/6292842/167646656-c223d25b-005c-4a93-8111-53d18941f271.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided raster-dem addSource configuration and custom WebP tiles. Trace how custom elevation tiles are handled where terrain is absent, then verify that the covered area renders at the correct elevation without floating relative to surrounding map regions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.