Select to view content in your preferred language

Show loading icon when map isn't loaded until later?

1314
1
01-07-2013 05:40 AM
TracySchloss
Honored Contributor
All the examples I've seen for showing a loading have a listener set to the map.
         dojo.connect(map,"onUpdateStart",showLoading);
        dojo.connect(map,"onUpdateEnd",hideLoading);


My project doesn't load the map at the beginning.  Instead, the users runs a query or find which generates a list.  Only after the list is displayed do they have the option to see the results of their query/find on a map. 

It takes a moment for the page to open.  If the user selects a county or enters an address before it's fully initialized, they get errors. I feel like too much is still loading at the beginning.  I tried commenting out the dojo.addOnLoad(init) that most examples have because I know I don't need the map until the user makes some sort of selection.  Still it seems to be accessing the baselayers right when I start.

I can add the loading image at start up by putting it in my top borderContainer, but I need to have something else besides the map's onUpdateEnd event to trigger the hideLoading function.
http://wwwgis.dhss.mo.gov/Website/VCFprovider/provider.html
0 Kudos
1 Reply
CraigMcDade
Deactivated User
I have a loading message in one of my apps that appears when I start the search and then leaves when the results are found. I did this simply with:

grid.showMessage("Loading...");


I placed it above the line that returns the results.

This may be useful to you, not sure.
0 Kudos