Here is my code...a code working perfectly but only with Google
Chrome...A sleep function to wait between requests on Load events...

Do you know a way to make this work in firefox without 620 errors? I
tried to change the delay but...doesn't work...

function sleep(milliseconds) {
    var start = new Date().getTime();
    while ((new Date().getTime() - start) < milliseconds){
        break;
    }
}

function getDirections(directionsArray){
    for(i=0;i<directionsArray.length;i+=2){//
        var directions = new GDirections(map);
        GEvent.addListener( directions,"error", function() {
            alert("GDirections Failed: "+directions.getStatus().code);
         } );
        GEvent.addListener( directions,"load" , function() {
                sleep(200)
         });
         directions.loadFromWaypoints( [directionsArray
[i],directionsArray[i+1]] );
         delete(directions);
     }
}

--

You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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.


Reply via email to