mapbox / mapbox/mapbox-gl-js

symbol, circle, fill-extrusion *-translate properties do not account for terrain height

Open
#10,264 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently `*-translate` properties are implemented by applying[ the translation to the projection matrix of the tile](https://github.com/mapbox/mapbox-gl-js-internal/blob/72082ca47f0c74aeb9c1610c5e861d0eed386721/src/render/painter.js#L619).

Elevation lookups inside various shaders get the height value per-vertex/per-feature using tile-coordinates, which do not have the translations applied.
This effects `circles`, `fill-extrusions` and `symbols`.

`fill-extrusion-translate` and `fill-extrusion-translate-anchor: "map"` used to move a fill-extrusion off the hill.
![2020-10-08 12 52 34](https://user-images.githubusercontent.com/1449257/95506847-5c4f9b80-0965-11eb-9d57-e250ee8b9f85.gif)

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 at the linked translation logic in src/render/painter.js around line 619, then trace the elevation lookups used by the circle, fill-extrusion, and symbol shaders. Compare how tile-coordinate heights are obtained with how *-translate is applied. Done means translated circles, fill-extrusions, and symbols remain correctly aligned with terrain, including fill-extrusion-translate with map anchoring.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.