Select to view content in your preferred language

MapView whenOnce is loaded

463
1
12-22-2022 09:48 AM
GregoryBologna
Frequent Contributor

How do I whenOnce when a MapView is loaded, including any buttons added to ui?

Please include link to referenced api. Thanks.

This doesn't work.

reactiveUtils.whenOnce( () => view.loaded) .then(() => { ... }); 

0 Kudos
1 Reply
LaurenBoyd
Esri Contributor

Hi @GregoryBologna ,

You could use the when method on the MapView or watch the ready property on the MapView with the whenOnce method from reactiveUtils. The following codepen shows both ways: https://codepen.io/laurenb14/pen/MWBjaWZ?editors=1000 

Hope this helps!

Lauren
0 Kudos