I don't have an example, but the suggested strategy is to calculate the straight line distances to all your service providers and make a shortlist of the 10 or so nearest ones and use GDirections on them. This doesn't absolutely guarantee that the closest 3 by road distance are found, but it avoids the long delays and quota problems which would be involved in an exhaustive search.
Once you've got your shortlist, create a single loadFromWaypoints request that goes from the user to location 1, then back to the user and out to location 2, etc. This allows you to process all 10 locations in a single GDirections call. When the data comes back, read through the GRoute()s to find the distances of the individual sections. -- 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 -~----------~----~----~----~------~----~------~--~---
