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:
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:
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:
1. The words should be updated when the slider changes, it should be:
Areas in shadow for more than 4 hours
The label is not updated when the slider moves?
2. The duration when the duration is zero seems to be corret.
3. The color when the duration is zero still in red, not sure the reason.
ArcGIS team did great work as usual indeed.
Shadow Cast component | Sample | ArcGIS Maps SDK for JavaScript 4.32
If the trivial bugs with color for sliders got fixed, then it should be fantastic feature for our customers.
Probably it is a bug, probably I am wrong. Please rectify my misfiring.
Hi @TedZhou thank you for your report!
Here are replies to your first 4 points:
1. sceneView.environment.lighting.directShadowsEnabled is used to toggle general shadows and has no effect on the Shadow Cast analysis. To avoid the confusion, the sample disables those shadows.
2. Colors can be configured as following: https://codepen.io/gsoosalu/pen/ZYEJNrK
3. Slider 0 shows shadows at that exact time. Therefore, the rendered shadow is correct, but the text in the tooltip "Total time in shadow: 0 seconds" is misleading. We'll look into making it clearer.
Update: also, I now understand that what confuses you is also that that duration of e.g. 15 mins shows no analysis but duration 0 shows something. We'll look into fixing that as well. Thanks for reporting this!
4. The date shown in the ShadowCast widget needs to be set with widget.viewModel.date and widget.viewModel.utcOffset properties. sceneView.environment.lighting.date has no effect on the Shadow Cast widget.
And regarding you further comments:
1. It is by design that the title of this slider does not include the value - the value comes from the slider itself. But we'll bring the feedback to our team and will review your comment.
2. Not clear what you mean here.
3. Note that the time slider is set to midnight and as the Shadow Cast analysis doesn't take the terrain into account (documented here under Known Limitations), the results show up unexpected.
In general, I advise you not to use the Shadow Cast widget if
a. the slider is set to time that is before sunrise or after sunset
b. for viewing shadows with duration 0. For shadows at a certain time point you can use the Daylight widget instead.
Thanks again and let us know if this helps you further.
Additionally, could you explain what do you expect to see when the shadow duration is 0? Do I get it correctly that it would help you if no shadow was shown in that state?
Dear Grete:
Many thanks for your kind response and assistance.
Shadow Analysis is a fantastic feature for our customers and very complicated and actually a successful implementation for such complex and dynamic environments. If there are bugs, only a few trivial UI defects probably.
If the view model could provide such configurations then resolve my issues. I tried to hook on, but I failed this moment.
Thanks again for your kind assistance and efforts.
Kind regards,
Ted
Sorry, headingLevel is 2 rather than 6. I did not check.
[Updated]
Hi again Ted,
Thanks for your kind words and it is nice to hear that you and your customers find this tool useful!
Firstly, about the initial color, try setting the color as following (I also updated my app ) :
widget.viewModel.thresholdOptions.color = new Color("green");
Using the Color class's setColor method directly on the thresholdOptions.color doesn't work. Looks like a bug but I need to investigate further. Thanks for for reporting this!
Regarding the time zone - to my knowledge it is not possible to configure which of the options is shown when the dropdown opens. Could it be a workaround for you not to show the time zone at all? You can do that with (also added to my app ) :
widget.visibleElements = { timezone: false };
Hope this helps you further and in case you have more questions, let me know!
Best regards,
Grete
I double checked with the team and got the confirmation that the color needs to be set using new Color(). Using setColor directly on threshold options' color is not reactive so it is expected that the shadows in the view don't update.
Your report that the widget's color picker changes to green is a bug and we'll have it fixed. Thanks again for pointing this out!
Update: After investigating this further, this seems to be a technical limitation. But, as pointed out above, this doesn't occur when the color is correctly set using new Color().