On Jun 9, 9:27 am, mariovi <[email protected]> wrote: > Hi, I have the following resumed code > > main > stuff... > rx=0; > calculateVolumen() > > function calculateVolumen(results, status) > if (rx==1) > //process results > alert(results.length); //creates a pause > rx=0; > jj++; // go to next task > calculateVolumen() > else //means rx==0 > //test end of tasks and exit if reach end > //prepares segment to get elevations from > rx=1; > //call evelation service....getElevationAlongPath..., > calculateVolumen) > > if I comment the alert, the programs fails, sending that > results.length is null or is not an object. With the alert, program > run nicely as long as I dont press fast the alert, if I press > repeatedly fast the alert, also fails. > I need the program to behave wihout pauses, can you explain this > behavior? or how to fix it? > As you can see, the programa alternates execution between the true and > false secctions of the IF.
I can't see that from a code dump. If you provided a link to your map, I might be able to. > thanks a lot friends > mariobi40 The elevation service is asynchronous. Usually if it works with an alert but doesn't work without it, it means you are trying to use the results outside of the callback routine. -- Larry -- 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.
