I want to update the layer to be shown in the swipe widget, including leading layer and trailing layer.
I am able to use event listener to update layer shown in the map when I am not using the swipe widget. But in the swipe widget, how to update the contents according to specific event, for example the response of a radio button? I t is poosible to use view.ui.add(swipe) to change the content in the swipe, but with this method a new swipe will be created each time.
So, is there any methods to obtain the swipe widget and change its content (the layers) interactively?