deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Maplibre/Mapbox elevation support w/o terrain

Open brncsk opened this issue 3 months ago • 0 comments

getViewState() in deck-utils.ts only calls centerCameraOnTerrain() when terrain is enabled:

https://github.com/visgl/deck.gl/blob/024534cc087af7c10c5c6d1316cf06bffe01cceb/modules/mapbox/src/deck-utils.ts#L239-L242

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.

brncsk avatar Aug 28 '25 04:08 brncsk