In the JSAPI 3.x is was possible to show progress indicators while a (feature) layer was loading - thanks to the update-end event.
Unfortunately, I do not find an equivalent in 4.4 yet.
Any plans to implement this (and quite a few other events that are still missing) soon?
Solved! Go to Solution.
Take a look at Rene Rubalcava's blog: Quick Tip: ArcGIS API 4 for JS - When stuff is ready? - odoenet
Thank you for the link! This seems to be what I've been looking for:
self.mapView.whenLayerView(fl).then(layerView => { watchUtils.whenFalse(layerView, 'updating', () => { console.log('The layer is now visible!'); }); });
In the 4.XX API, layers are promises.
let fLayer = new FeatureLayer({url: ...});
map.layers.add(flayer);
fLayer.then(fl => console.log('layer is loaded'));
Thank you. However, the layer promise seems to get resolved as soon as the layer object is created and not when it has been loaded to the map.
So 'layer is loaded' is displayed almost instantly and the layer might still load data from the mapservice and is busy displaying them in the map.