Maplibre/Mapbox elevation support w/o terrain
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
getViewState() in deck-utils.ts only calls centerCameraOnTerrain() when terrain is enabled:
However both base map providers (Mapbox & MapLibre) support setting camera elevation even when terrain is disabled. (Mapbox by using Map#setFreeCameraOptions(), MapLibre by using Map#jumpTo({ elevation: ... })).
I'm using this configuration (camera elevation, but no terrain) to render 3D models in tandem with map markers for architectural visualizations. Deck.gl layers in this mode are being rendered at an incorrect altitude due to not taking camera elevation into account.
It'd be nice if deck.gl supported this use case by either calling centerCameraOnTerrain() unconditionally or (if it's a performance optimization) by providing a configuration option to do so.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/mapbox/src/deck-utils.ts at getViewState(), especially the conditional call to centerCameraOnTerrain(). Read how the Mapbox and MapLibre camera elevation APIs behave when terrain is disabled, then verify that deck.gl layers use the camera elevation correctly in that configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100