[OpenLayers-Users] Function on loadend

Christopher Schmidt crschmidt at metacarta.com
Thu Sep 25 15:04:54 EDT 2008


On Thu, Sep 25, 2008 at 07:53:05PM +0200, Arnaud Vandecasteele wrote:
> Hi Christopher Schmidt,
> 
> And thanks for your answer but i don't understant it.
> Indeed the console.log was here only to help to know the result of my
> function.
> And when i want to use a return it awlays give me undefined result like for
> this : return this.features.length.

returning from an event handling function doesn't make sense. You have
to write the code into a callback -- either a seperate function or an
anonymous function (as I demonstrated). That function will be called
*later*, when the code is done running: It's not a synchronizization call. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list