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

Brent Pedersen bpederse at gmail.com
Wed Oct 12 12:08:19 EDT 2005


hi, i looked at this only briefly, this is close to what you're doing but
how about a check in imgOnLoad() like

if(this.id==this.parentNode.parentNode.lastChild.lastChild.id && this.src !=
this.kaMap.aPixel.src)

i _think_ that might check if the current 'this' has the same id as the last
tile image.


On 10/12/05, Peter Giencke <pgiencke at glc.org> wrote:
>
> 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...
>
> -pete
>
> 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
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20051012/7926f0e5/attachment.html


More information about the ka-Map-users mailing list