In the art of creating great applications, one of the most important things to take into account is the user experience. A good application does what it must do, but it does this by making the user feel comfortable.
When working with remote servers, a lot of time is spent waiting for data retrieval. For example, when working with a tile service, every time we change the zoom level or pan the map, the user has to wait for some time until the data is obtained from the server and the tiles start rendering.
It would be great to show some feedback to the user with a spinner icon, a progress bar, or other familiar visual cues that inform the user that the application is working but needs some time.
This recipe shows us how we can give some feedback to the user by displaying when the application is loading content from an external service, making use of some layer events.
The source code can be found in
ch04/ch04-map-loading-progress. For convenience...