Hello. I need your help for a problem I'm having with the Javascript API. I have a website that has some tabs, the first of which is where is the map created with the API. The problem is that, eventually, some user goes directly to another tab before the map loading is finished and when he returns to the map tab, the loading was stopped in the middle and the map is incomplete. Is there any way to control the loading of Widgets? I know that there are some methods, however, they don't seem to work very well, for example, I have a Slider that I want to hide the label, however, I need to wait to load the label to do this. So, I use 'updating', but it doesn't always work, follow the code snippet:
view.watch('updating', function(evt){
query('.esri-slider__label')[0].classList.add("hide");
});
Try using the watchUtils, it might do what you need.
watchUtils.whenFalseOnce(view, 'updating' function(evt){
query('.esri-slider__label')[0].classList.add("hide");
});
I'd suggest John Grayson s approach as well as trying to put some parts of your code inside of a view.when()
view.when(function(){
//parts of your code
});