Hi, How can I have a notification or signal when a service feature table loads finish?
I test with signals
loadStatusChanged
and
LoadOrRefreshFeaturesStatusChanged
but with the first, returns Ok immediately, and with the second one I haven't answer.
The service feature table delays about 15-30 secs to gather all the data.
Maybe I missed something...
Are there any particular reasons you are using LoadOrRefreshFeaturesStatusChanged?
You should be able to listen to the load status of the service feature table using the following:
serviceFeatureTable.loadStatusChanged.connect(()=> {
if (serviceFeatureTable.loadStatus !== Enums.LoadStatusLoaded)
return;
//Perform other operations if the service feature table is loaded...
});
If you are set on using the second signal, you can see why it is erroring out by connecting an error changed listener and getting the exact error:
serviceFeatureTable.errorChanged.connect(()=>{
console.log(serviceFeatureTable.error.message + serviceFeatureTable.error.additionalMessage);
});
Hi,
The LoadStatusChanged event tells you when the object has fetched it's metadata, e.g. in the case of a ServiceFeatureTable that means it's made the initial request to the service to get the JSON definition of the table/layer. After than, once the ServiceFeatureTable is the source for a FeatureLayer in a MapView, then it starts requesting features based on the visible extent and/or queries (depending on what functionality you write in your app).
There are additional events on the GeoView (MapView/SceneView) that you can listen to if you'd like to know: