mapbox-gl-shadow-simulator icon indicating copy to clipboard operation
mapbox-gl-shadow-simulator copied to clipboard

unclear documentation

Open Thebigbignooby opened this issue 1 year ago • 2 comments

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
        }
      },

Thebigbignooby avatar Jul 20 '23 00:07 Thebigbignooby