We recently migrated our ArcGIS Maps SDK widgets to map components as Esri will deprecate the traditional widgets.
In our use case, we visually nest our widgets into Expand widgets. The user clicks on an Expand button to activate a certain 3D tool:
In the example of the ShadowCast widget shown in the screenshot above, this makes sure that the red shadow is displayed / casted only when the widget is launched by the user. Also, the user can resume to the previous widget state. Another advantage is, that the performance of the scene doesn’t degrade as the user can selectively start a certain widget.
Before our migration, we watched the expanded state of the button continuously to start or stop the respective nested widget via the “visible” property:
reactiveUtils.watch(
() => sliceExpand?.expanded,
(expanded) => {
sliceWidget.visible = expanded;
}
);
After our migration to map components, I tried to reimplement this use case. As the “visible” property doesn’t exist anymore, I noticed, that there exist start() and stop() methods I can potentially use. However, I noticed the following:
To highlight the desired behavior and the old implementation with conventional widgets, I have attached three videos.
To highlight the current behavior with components, I created a pen: https://codepen.io/Stezi/pen/zxGqaWv?editors=1000
Thanks for reaching out, that's important input! We'll look into this and I might get back to you with additional questions.
Hi again,
First, do I get it correctly that you're mainly looking for a way to hide and show again (not only clear) the measurement/slice from the view? e.g. that when closing the measurement tool, the line/area would disappear but when expanding the tool again, the previously created one reappears.
For the two measurement components, Slice and Line Of Sight I can give you a workaround until we add the missing capabilities to them: you can use the analysis object connected to the component to toggle its visibility (or clear the analysis). See this app with Line Of Sight as an example:
https://codepen.io/gsoosalu/pen/pvJXomZ
In case of the Elevation Profile, I don't have a workaround at the moment but we are currently working on this component and hope to provide the missing capabilities in the upcoming releases.
First, do I get it correctly that you're mainly looking for a way to hide and show again (not only clear) the measurement/slice from the view? e.g. that when closing the measurement tool, the line/area would disappear but when expanding the tool again, the previously created one reappears.
That's correct.
For the two measurement components, Slice and Line Of Sight I can give you a workaround until we add the missing capabilities to them: you can use the analysis object connected to the component to toggle its visibility (or clear the analysis). See this app with Line Of Sight as an example:https://codepen.io/gsoosalu/pen/pvJXomZ
In case of the Elevation Profile, I don't have a workaround at the moment but we are currently working on this component and hope to provide the missing capabilities in the upcoming releases.
These are good news. Thanks for the feedback and the code sample!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.