> Then, when plotElevation_especial ends, it sets esperaj=1, so the
> while loop terminates, BUT, with this, the browser keeps sending me
> that there is inefficient code (the infinite loop).

That's right.  Don't do it that way.

> Could you give some hint in the array of tasks to do??? please

var array_of_tasks = .......

Asynchronous_function ( blah, blah, callback) ;

function callback()
{
     do whatever you need to do with the results
     ...
     pop off the next entry in the array
     if (next entry is valid)
           Asynchronous_function ( blah, blah, callback) ;
     elseif (no more entries)
          do whatever you wanted to do when all results returned
}

Note that there is no loop of any kind.

Beware Google's services have limits to the rate of requests ; you
could put in a setTimeout for the asynchronous call to slow thigs down.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to