maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.76k stars 729 forks source link

Add 3DTiles as source for terrain layer #4493

Open AbelVM opened 4 months ago

AbelVM commented 4 months ago

As 3DTiles are gaining traction (Cesium, OGC, Google, MapTiler, etc.), MapLibre should be able to get the most of it.

Rendering a custom layer from a 3DTiles source is already solved through DeckGL, but maybe a killer feature would be to use those tiles as terrain source, with all the added functionality:

HarelM commented 4 months ago

Terrain has multiple manifestations: 3D terrain, hillshade, querying for elevation. I'm not sure how all of these work, but basically the DEMdata class is responsible to get elevation for a specific location. If you can show an example of how to use 3D tiles to get the elevation for a specific place then there might be a way to create a 3DtilesDEMSource similar to RasterDEMSource I guess. I have little knowledge in 3D tiles unfortunately...

AbelVM commented 4 months ago

As of today, CesiumJS API has 2 functions to do so that might inspire us:

(links point to a starting point to dig in Cesium code :sweat_smile: )

First function is so reliable on zoom level, so we can just dismiss it. I've worked a bit on it, so I might keep on researching, but the current approach is based on deckGL as there is no native way to load 3DTIles yet