[ka-Map-users] Re: Code to indicate tiles have finished loading?

Peter Giencke pgiencke at glc.org
Wed Oct 12 10:49:45 EDT 2005

Paul et al,

I've finally had some time to start working on this issue. My current course
of action is to keep track of the number of images set/created and compare
that by implementing a counter in imgOnLoad. 

The problem I'm running into is that the number of set/created images is
always lower than the actual number of images calling to the onload
function. Here's what ka_map is reporting for a simple ka_map instance:

Not a_pixel images calling imgOnLoad: 98
a_pixels images calling to imgOnLoad: 210
Total number of calls to imgOnLoad: 308

setTile images set: 224
Created via createTile: 140

Am I missing something, or is there a better way to gauge the total number
of pictures set/created to compare with the imgOnLoad counter...


Paul Spencer wrote:
> Peter,
> there could be :)  The way things are working right now (iirc) is  
> that each image on each layer has its src changed when something  
> happens like a pan or a zoom.  This *could* be tracked in kaMap by  
> incrementing a variable that indicates the number of tiles left to  
> load.  Each image has an onload event that is triggered to make the  
> image visible (it is set to not visible when the src is changed)  
> which could also decrement the tile count.
> We could add a new event to indicate the that load status has changed 
> but this may involve some thrashing if the images load quickly before 
> the loop to set the src has finished (I don't even know if this is a 
> possible scenario).
> Another way would be to have your app set a timer to check the load 
> status every 100ms or so and see if the load count has hit zero ...
> If you come up with a good way in your app, share it with me and I'll 
> put it in cvs as I think this is a generally useful function.
> Cheers
> Paul
> On 6-Oct-05, at 4:22 PM, Peter Giencke wrote:
>> Paul et al,
>> Is there a lightweight way to determine when ka-map has finished 
>> loading all layers for a particular view? I'm utilizing some WMS 
>> layers for one particular ka-map instance, and would like to indicate 
>> (with an  icon or
>> something) that the mapplication is actually doing something while  
>> it's fetching/creating the tiles.
>> -pete
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Applications & Software Development                              |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

ka-Map-users mailing list
ka-Map-users at lists.maptools.org

More information about the ka-Map-users mailing list