Demonstration of a function for removing a loading screen after map/feature services have been loaded to the map. If a service fails to load (error event), an error message appears. After the message is closed, the loading screen is removed.
I add a property (isLoaded) to the map/feature service object to hold a boolean for whether the service is loaded or not. I hook into the "load" and "requesterror" error events to change the value for the isLoaded property.