stac-layer icon indicating copy to clipboard operation
stac-layer copied to clipboard

Allow to set style information

Open m-mohr opened this issue 3 years ago • 2 comments

Originates from https://github.com/radiantearth/stac-browser/pull/151#issuecomment-1166643330

m-mohr avatar Jun 27 '22 09:06 m-mohr

So it looks like the options object of stac-layer is passed in to the creation of all the leaflet vector layers, so you can just pass in any leaflet path options to control the styling.

        const lyr = await L.stacLayer(item, {
          debugLevel: 2,
          displayPreview: true,
          // Any valid leaflet path options
          color: 'red'
        });

127 0 0

So maybe all that's required is adding something to the doco?

rowanwins avatar Jul 06 '22 04:07 rowanwins

It's indeed possible to pass things through, but it's not very clean that all these additional options get handed over as well. Still, it works so just a bit of documentation might be enough for now.

m-mohr avatar Jul 08 '22 19:07 m-mohr

Supported in the stac-js branch via itemStyle and boundsStyle options.

m-mohr avatar Mar 02 '23 23:03 m-mohr