Hi Larry, the callback routine is calculateVolumen, and the alert is inside this routine. I tried to follow the execution by printing alerts like "rx=0", "rx=1", at the beginning of the IF and ELSE, so when the program runs ok, it prints rx=0, rx=1,rx=0, rx=1,rx=0, rx=1 etc, etc somehow, it prints rx=0, rx=1, rx=1, and at this point is when the failure occurs, but I dont see how this could have happended. Can you see?
My code is my pc, inside my company, how can I share it to you? greetings mariobi40 On 9 jun, 11:40, "[email protected]" <[email protected]> wrote: > 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- Ocultar texto de la cita - > > - Mostrar texto de la cita - -- 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.
