Select to view content in your preferred language

Migrate stop / resume widget functionality to components

89
1
a week ago
Status: Under Consideration
Labels (1)
StefanUseldinger
Frequent Contributor

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:

StefanUseldinger_0-1749539518767.png

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:

  • For the LineOfSight and ElevationProfile widgets, it is not possible to implement the same behavior with the start() and stop() methods. The lines drawn by the user disappear only when the widget is reopened (start() method called). They stay visible even though the stop() method is called.
  • The Slice widget has no stop() method. This means, I cannot stop/resume the slice performed by the user in the scene as it remains visible the whole time.
  • The Measurement, Weather and Daylight widgets don’t offer any of these two methods. For the Weather and Daylight widgets, this is ok for me. However, in the example of the measurement widget, I cannot remove the measurement lines drawn by the user from the scene.
  • The ShadowCast widget works fine.

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

Tags (1)
1 Comment
GreteSoosalu
Status changed to: Under Consideration

Hi @StefanUseldinger 

Thanks for reaching out, that's important input! We'll look into this and I might get back to you with additional questions.