[OpenLayers-Users] ajax onfailure does not decrease requests counter

Christopher Schmidt crschmidt at metacarta.com
Sun May 13 12:35:14 EDT 2007


On Sun, May 13, 2007 at 04:54:06PM +0100, Duarte Carreira wrote:
> 
> Hi all.
> 
> I'm using OL2.3 and I'm using loadURL as the ajax mechanism.
> 
> I use OpenLayers.Ajax.Responders.register to show and hide a small animated icon to show when client-server communication is going on. This works fine until there's a failed request.
> 
> As far as I can see, when an ajax request fails OL does not update OpenLayers.Ajax.activeRequestCount, so my function does not hide the animated icon.

Huh. That's interesting, because I'm sure that onComplete is called
(when registered as an option to Ajax.Request) on failures...  

> I feel the counter should be decreased every time a request terminates, even if it failed.

Agreed.

> Also, I don't know if the responder onComplete gets fired when a request fails.

I'm under the impression that it does, but if it doesn't, patches to
that part of the code to make it do the right thing are welcome. Feel
free to open a ticket on the topic.  

> As long as I'm on the subject I would like to ask if there's a way to know when tiles have finished loading on a map or layer? I have searched the list for this and did not find a solution. But OL is evolving so fast I'm hoping maybe there is.

I think WMS.Untiled has this ability, but other layers don't -- for the
same types of problems you're now running into with Ajax :)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list