Question: Is there global event when everything is loaded

285
6
02-29-2024 04:39 PM
Aeseir
by
Occasional Contributor

When pre-loading information to a map such as Feature Layers, Features etc. it can take time to load all the information.

Before we build our own custom global notifier, I wanted to know if there is a existing tracker in Map or view that is triggered while load process is taking place that we can plug into?

0 Kudos
6 Replies
ReneRubalcava
Frequent Contributor

The closest is the view.ready property. This doesn't necessarily mean that everything is done drawing, only that the map and layers have been loaded. Correction, layers are created, but not yet loaded.

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ready

0 Kudos
Aeseir
by
Occasional Contributor

I can't seem to find your reference to ready, all it does it takes me to resizeAlign.

 

Regardless seem like we need to build a global event to track this.

0 Kudos
BlakeTerhune
MVP Regular Contributor

MapView ready is right above resizeAlign in the documentation Rene linked to.

0 Kudos
Aeseir
by
Occasional Contributor

we are seeing 2 different versions of documentation then because i can't see it and here is the image to prove.

Aeseir_1-1709439602760.png

 

0 Kudos
ReneRubalcava
Frequent Contributor

Click on "Show inherited properties"

1000002615.png

Aeseir
by
Occasional Contributor

Thanks for the tip @ReneRubalcava, missed that obviously.

Basically i am building my own event tracker service to handle this going forwards, as I haven't found anything suitable. 

0 Kudos