mapbox-gl-shadow-simulator
mapbox-gl-shadow-simulator copied to clipboard
unclear documentation
Hi, thanks for this library!
I'm trying to make it work with my map, I have followed the guide and I'm a little confused.
I have a mapbox map using mabox-gl, with 3d buildings and terrain from mapbox.
Given that I'm getting terrain from mapbox, do I still need this block? what exactly does this block do?
terrainSource: {
tileSize: 256, // DEM tile size
maxZoom: 15, // Maximum zoom of DEM tile set
getSourceUrl: ({ x, y, z }) => {
// return DEM tile url for given x,y,z coordinates
return `https://s3.amazonaws.com/elevation-tiles-prod/terrarium/${z}/${x}/${y}.png`
},
getElevation: ({ r, g, b, a }) => {
// return elevation in meters for a given DEM tile pixel
return (r * 256 + g + b / 256) - 32768
}
},