Is it possible to use terrain data in a custom style layer to shade the map? #4133
Replies: 2 comments 7 replies
-
Terrain data can be fetched from the tiles, source cache, and stuff like that. |
Beta Was this translation helpful? Give feedback.
-
@larsmaxfield |
Beta Was this translation helpful? Give feedback.
-
Is possible to use terrain data in a custom style layer to color the map based on elevation?
My goal is to have a custom layer which achieves this:
I achieved that^ by editing the existing shaders in the hillshading layer because they already have methods to calculate the elevation and shade the terrain.
I'd like to now properly implement this elevation coloring using the API.
Custom layers appear to be the way to do this because I can render custom WebGL content in them. However, I have not found a way forward which allows me to access terrain data and therefore determine elevation — that is why I'm asking here if it is even possible to do so.
Beta Was this translation helpful? Give feedback.
All reactions