Select to view content in your preferred language

Shadow Cast widget discrete color is not applied

175
0
02-21-2025 02:52 AM
UmutUcok
Emerging Contributor

I can save and load to apply shadow cast. For duration and threshold options, applying color seems working:

const viewModel = shadowCastWidgetRef.current?.viewModel;
const {discreteOptions,durationOptions,thresholdOptions,visualizationType} = viewModel;
const discreteColor = discreteOptions.color?.toHex();
const durationColor = durationOptions.color?.toHex();
const thresholdColor = thresholdOptions.color?.toHex();

// While loading:
const vm =  new ShadowCastViewModel({
        view,
        discreteOptions: {
        color: Color.fromHex(discreteOptions.color),  // this does not work
},
durationOptions: {
        color: Color.fromHex(durationOptions.color),
},
thresholdOptions: {
        color: Color.fromHex(thresholdOptions.color),
},
    });

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-ShadowCastView...

Is it a bug or is there another color property for discreteOptions.color? If visualizationType is Threshold or duration, it works. But discrete is not working.

0 Kudos
0 Replies