Shadow Analysis seems to be a very complex to me. ArcGIS team implemented it successfully should be not easy for them.
It is a good feature our surveyors wanted.
I configured the default color as below:
sceneView.environment.lighting.directShadowsEnabled = false;
const widget = new ShadowCast({
view,
container: panel
headingLevel: 2
});
widget.viewModel.thresholdOptions.color.setColor(pink);
widget.viewModel.durationOptions.color.setColor(purple);
widget.viewModel.discreteOptions.color.setColor(blue);
widget.viewModel.thresholdOptions.maxValue = 14;
widget.viewModel.visualizationType = 'duration';
1. Not sure the reason behind
sceneView.environment.lighting.directShadowsEnabled = false;
I tried to set to true. I did not notice any differences. I wish I could learn from you.
2. I set the default color as below:
widget.viewModel.thresholdOptions.color.setColor(pink);
widget.viewModel.durationOptions.color.setColor(purple);
widget.viewModel.discreteOptions.color.setColor(blue);
However, when the ShadowAnalysis appear the first time, the color for threshold still is red, probably the default color ArcGIS team set, not the color I set through view model.
I believe I may need to call the ShadowAnalysis to re-render to get it right. However, I reckon if I set the color through view model, the widget or the view should respond.
This issue I will try to find a way to get around myself.
3. Slider duration zero seems to be no effect at all?
Normal duration is correct probably. ArcGIS team did a good job.

the maximum duration I assume to be correct:

Move the slider to zero duration, then it still has some shadow? I need to confirm with our Surveyor otherwise I will get into trouble now. I cannot understand the fact zero duration still has shadow ?


4. How to properly set the date?
Using the default date?
Or just do as below:
widget.viewModel.date = new Date();
What are the differences? Shadow analysis relies on the timing and sun light.
I am under pressure with the slider with zero duration, which I really cannot understand why zero duration still have shadow.
I hope I could learn from you.
Thanks for your tips and advice.
Ted