I think you need an else clause in findNearest(). What seems to be happening is that you perform the if (counter==4) stuff, but after requesting the display of the chosen route you try to evaluate the distance to the next destination, which fails because you've fallen off the end of the array.
-- http://econym.org.uk/gmap The Blackpool Community Church Javascript Team --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
