My code is (asking elevations):
esperaj = 0;
var whitney = new google.maps.LatLng(36.578581, -118.291994);
var lonepine = new google.maps.LatLng(36.606111, -118.062778);
var pathh = [ whitney, lonepine];
var pathRequest = {
'path': pathh,
'samples': 256
}
elevator.getElevationAlongPath(pathRequest, plotElevation_especial33);
while (esperaj==0); //infinite loop until plotElevation_especial33
sets esperaj=1
. . .
. . .
function plotElevation_especial33(results, sstatus)
{
elevations = results;
esperaj=1; //this will end the infinite loop
alert('N::' + results.length);
}
PROBLEM:
First time the browser sends me the message: "Do you wish to stop
script?" this is because the infinite loop, If I say "no" will repeat
infinitely. If I stop the script, and then execute the code again
(clicking on button), this time will run PERFECT, I mean, eventually
esperaj=1 will be executed and the program will continue nicely, why
the first time, it doesnt work? any ideas?
NOTE: Because of the app, I have to make the calls behave
synchronous...
thans a lot
mariovi
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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-api?hl=en.